Total Pageviews

2013/11/12

How to fix com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException

Exception
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "reportName" (class gov.nta.ets.web.dto.Ets405rFormBean), not marked as ignorable (4 known properties: , "accYy", "type", "data", "funcId"])
 at [Source: java.io.ByteArrayInputStream@57a9b75a; line: 4, column: 18] (through reference chain: gov.nta.ets.web.dto.Ets405rFormBean["reportName"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:79) [jackson-databind-2.2.3.jar:]

Root Cause
This exception means that there are get and set methods of an object in your class and Jackson is unable to figure out during serialization and deserialization process.

Solution
Apply @JsonIgnore on getter method, i.e. getReportName
1:   /**  
2:     * Gets the report name.  
3:     *   
4:     * @return the reportName  
5:     */  
6:    @JsonIgnore  
7:    public String getReportName() {  
8:      return reportName;  
9:    }  

2013/10/17

Windows 無法自動偵測此網路的proxy設定


今天在公司,突然電腦無法上網,出現 "Windows 無法自動偵測此網路的proxy設定 (Windows could not automatically detect this network's proxy settings)"此錯誤訊息
檢查了網路孔沒問題、ip相關設定沒問題,也重開機了,還是無法上網

最後 Google 到兩個指令,依照以下四步驟就可以解決了(只是還是不知道原因是什麼):

  1. 打開命令提示字元 (open command line)
  2. 執行 netsh winsock reset (execute netsh winsock reset)
  3. 執行 netsh int ipv4 reset (execute netsh int ipv4 reset)
  4. 重開機 (reboot)


Reference:http://answers.microsoft.com/en-us/windows/forum/windows_7-networking/windows-could-not-automatically-detect-this/d243dea1-d1c8-4c4a-ba96-2b49bc9bab1a

2013/09/24

How to Change User in TortoiseSVN

Question
When I authenticate with a Subversion server, the username and password are cached locally so I don't have to keep entering them each time. But I would like to clear username and password data for some reasons, how do I do?

Answer
1. Right Click --> Settings

2. Choose "Saved Data", then click "Clear" button which besides Authentication data. It clear all authentication data, then you can enter another username and password.


2013/09/03

SP2-0734: unknown command beginning "alter tab..." - rest of line ignored.

Problem
I would like to execute a SQL script file with simple alter table script  as follows:

But it showed this error message:
1:  SQL*Plus: Release 11.2.0.2.0 Production on Tue Sep 3 08:03:36 2013  
2:  Copyright (c) 1982, 2010, Oracle. All rights reserved.  
3:  Connected to:  
4:  Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production  
5:  With the Partitioning, Oracle Label Security and Oracle Database Vault options  
6:  SP2-0734: unknown command beginning "alter tab..." - rest of line ignored.  
7:  SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0  
8:  - 64bit Production  


With the Partitioning, Oracle Label Security and Oracle Database Vault options

Root Cause
It resulted from the SQL file has BOM character:
Solution
What you need to do is to convert the encoding of SQL file to UTF-8 without BOM and execute again, then this problem will be resolved.

2013/08/28

Utilize ime-mode property to Control Input Method Editor

Problem
Customer asked to control textfield1 can only fill in alphanumeric, textfield2 can fill in alphanumeric and Tranditional Chinese

Solution
We can use ime-mode CSS property to controls the state of the input method editor for text fields.

The default value of ime-mode property is auto, it means "no change is made to the current input method editor state".

If you would like to disable input method editor to allow for numbers and alphabets only, set the property of ime-mode property to "disabled".


If you would like to activate input method editor to allow for numbers, alphabets, and Tranditional Chinese, set the property of ime-mode property to "active".


Demo


Pay attention to some properties do not be supported by specific browser.

Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/ime-mode

2013/07/24

ORA-01452: cannot CREATE UNIQUE INDEX;

Problem
As DBA rebuilt index, it produced error report as following:

Root Cause
Based on the NIGT021 schema, it only has one primary key. Therefore, it may has abnormal and duplicate data in NIGT021.

Solution
1. Figure out abnormal data
2. Delete abnormal data
3. rebuild index

Here is the SQL statement template to find duplicate value in this table
   select column_name, count(column_name)
   from [table]
   group by column_name
   having count (column_name) > 1;
Here is an example to apply to NIGT021
   select pnsh_tp, count(pnsh_tp)
   from nigt021
   group by pnsh_tp
   having count (pnsh_tp) > 1;

2013/06/22

2013/06 高雄

85大樓


俯瞰高雄港


愛河夜景


駁二特區

2013/05/24

Utilize SVN relocate to change repository's root URL

Problem
Administrator changed the location of repository for some reason. The content of the repository doesn't change, but the repository's root URL does.
If we utilized old URL, it will show failed error message as bellows:

Solution
We can use "SVN relocate" to change the repository's root URL.
Step1. Right Click --> TortoiseSVN -->Relocate

Step2. Change the repository's root URL, and click OK

Then you will get successful dialog as bellows:

Finally, we do SVN update to test if it works or not


2013/05/01

2013/05 Singapore


Singapore flyer

Singapore flyer


Singapore Foods

Singapore早餐必備兩顆生雞蛋

The Jewelry Box

Bird view from Jewelry Box

Universal Studio

S.E.A Aquarium

Singapore Zoo

Singapore Botanic Gardens

Singapore 夜景

Singapore 夜景

Singapore 夜景

2013/04/23

The Software Craftsman


Top 10 Traits of a Rockstar Software Engineer

  1. Loves To Code
  2. Gets Things Done
  3. Continuously Refactors Code
  4. Uses Design Patterns
  5. Writes Tests
  6. Leverages Existing Code
  7. Focuses on Usability
  8. Writes Maintainable Code
  9. Can Code in Any Language
  10. Knows Basic Computer Science

2013/04/15

Test a string for a numeric value


Environment 
Oracle 11g

Problem

I write wrong value into specific column, it should accept numeric only.


Solution

To test a string for numeric characters, you could use a combination of the length function, trim function, and translate function built into Oracle.

You can use the following command:




This function will return a null value if vio_yr is numeric. It will return a value "greater than 0" if vio_yr contains any non-numeric characters.


Reference: http://www.techonthenet.com/oracle/questions/isnumeric.php

2013/04/09

ALL_TAB_COLUMNS Usage

Environment 
Oracle 11g 

Problem 

Customer requests to update ACS_NO this column length from 8 to 10. But I have more than 100 tables in my system, how do I quickly get the table which have ACS_NO column? 

Solution 

Making good use of ALL_TAB_COLUMNS. ALL_TAB_COLUMNS provides by Oracle, it describes the columns of the tables, views, and clusters accessible to the current user. 

We can use this SQL statement to find out the result:



See....we can get the result easily, and start to author alter table script.



Reference : http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_2094.htm