cancel
Showing results for 
Search instead for 
Did you mean: 

Error when commit is called on Hanheld Application

Former Member
0 Kudos

Hi All,

I have created an appliaction where an order is selected which then displays items below , the quantity field is editable . The value in one of the rows and press a button to trigger a commit of the change to the local database but I am getting the following error

java.lang.ClassCastException: java.lang.Long

at com.sap.tc.mobile.cfs.pers.StringFormatter.format(StringFormatter.java:136)

at com.sap.tc.mobile.cfs.pers.StringFormatter.format(StringFormatter.java:211)

at com.sap.tc.mobile.cfs.pers.StringFormatter.format(StringFormatter.java:154)

at com.sap.tc.mobile.cfs.model.impl.ModelClass.getCollectionOfValues(ModelClass.java:388)

at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.doUpdate(ModelClassCache.java:104)

at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.flush(ModelClassCache.java:63)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.flushCache(PersistenceManager.java:899)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.commit(PersistenceManager.java:635)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.commit(PersistenceManager.java:627)

at com.sap.tc.mobile.sf.OcaRoot.commit(OcaRoot.java:114)

I have a mixture of types within the model that were generated by the DOE Import, when I change any of the long types to string the commit works this is the same for big decimals. I have searched OSS but cannot find any notes, surely this does not mean that all types within the model have to be string?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member206242
Active Participant
0 Kudos

Hi,

Ofcourse all fields can not be string. there is formatting issue in the application code.

Please make sure you use Java 1.3 APIs for all application logic, specially casting.

Regards,

Nipun

anesh_kumar
Active Participant
0 Kudos

Hi

Check your Data object in the service explorer tab

the editable field will be of type long. try to maintain the same type of value attribute in your component and view controller context

that should solve your issue

thanks

Former Member
0 Kudos

Hi,

Which version of client are you using?

Regards,

Dhanya