Tuesday 6 October 2015

ADF : Resolved! Failed to convert internal representation error in ADF

While development some times this error occurs in VO's and EO's in ADF.

Main Cause : The main cause of this error is that the Datatype mismatch of the Columns in Database and  in ViewObject (or Entity Object).

For example : Suppose you have a DEPT_ID String Column in the Database of type String and in EntityObject or ViewOject its type is Integer then this error will occur.

What happens is that when the framework tries to convert the value in the database i.e (String in this case like 'DEPT_01') to the type defined in the ViewObject or EntityObject i.e. Integer, then it fails to type cast 'DEPT_01' to Integer as it contains character that cannot be converted to Integer and this error is thrown.

Solution : Make sure the all the datatype of all the attributes in the ViewObect or EntityObject are in Sync with the database and there is not mismatch.