
|
If you were logged in you would be able to see more operations.
|
|
|
|
If an entity has a field defined as java.lang.Float, then sending a client object to the server, and then retrieving it back results in this exception:
java.lang.IllegalArgumentException
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
at java.lang.reflect.Field.set(Field.java:656)
at org.objectstyle.cayenne.property.FieldAccessor.writePropertyDirectly(FieldAccessor.java:115)
at org.objectstyle.cayenne.property.SimpleProperty.writePropertyDirectly(SimpleProperty.java:119)
at org.objectstyle.cayenne.property.SimpleProperty.writeProperty(SimpleProperty.java:90)
at org.objectstyle.cayenne.map.EntityDescriptor$SimplePersistentProperty.writeProperty(EntityDescriptor.java:341)
at org.objectstyle.cayenne.util.ObjectDetachOperation$1.visitProperty(ObjectDetachOperation.java:195)
at org.objectstyle.cayenne.property.SimpleProperty.visit(SimpleProperty.java:98)
at org.objectstyle.cayenne.property.BaseClassDescriptor.visitProperties(BaseClassDescriptor.java:250)
at org.objectstyle.cayenne.util.ObjectDetachOperation.detach(ObjectDetachOperation.java:134)
at org.objectstyle.cayenne.access.ClientServerChannelQueryAction.toClientObjects(ClientServerChannelQueryAction.java:221)
at org.objectstyle.cayenne.access.ClientServerChannelQueryAction.interceptObjectConversion(ClientServerChannelQueryAction.java:181)
at org.objectstyle.cayenne.access.ClientServerChannelQueryAction.execute(ClientServerChannelQueryAction.java:106)
at org.objectstyle.cayenne.access.ClientServerChannel.onQuery(ClientServerChannel.java:99)
at org.objectstyle.cayenne.remote.service.DispatchHelper.dispatch(DispatchHelper.java:76)
at org.objectstyle.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:182)
As it turned out Hessian serializes Floats as Doubles... Will have to add a custom handler.
|
|
Description
|
If an entity has a field defined as java.lang.Float, then sending a client object to the server, and then retrieving it back results in this exception:
java.lang.IllegalArgumentException
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
at java.lang.reflect.Field.set(Field.java:656)
at org.objectstyle.cayenne.property.FieldAccessor.writePropertyDirectly(FieldAccessor.java:115)
at org.objectstyle.cayenne.property.SimpleProperty.writePropertyDirectly(SimpleProperty.java:119)
at org.objectstyle.cayenne.property.SimpleProperty.writeProperty(SimpleProperty.java:90)
at org.objectstyle.cayenne.map.EntityDescriptor$SimplePersistentProperty.writeProperty(EntityDescriptor.java:341)
at org.objectstyle.cayenne.util.ObjectDetachOperation$1.visitProperty(ObjectDetachOperation.java:195)
at org.objectstyle.cayenne.property.SimpleProperty.visit(SimpleProperty.java:98)
at org.objectstyle.cayenne.property.BaseClassDescriptor.visitProperties(BaseClassDescriptor.java:250)
at org.objectstyle.cayenne.util.ObjectDetachOperation.detach(ObjectDetachOperation.java:134)
at org.objectstyle.cayenne.access.ClientServerChannelQueryAction.toClientObjects(ClientServerChannelQueryAction.java:221)
at org.objectstyle.cayenne.access.ClientServerChannelQueryAction.interceptObjectConversion(ClientServerChannelQueryAction.java:181)
at org.objectstyle.cayenne.access.ClientServerChannelQueryAction.execute(ClientServerChannelQueryAction.java:106)
at org.objectstyle.cayenne.access.ClientServerChannel.onQuery(ClientServerChannel.java:99)
at org.objectstyle.cayenne.remote.service.DispatchHelper.dispatch(DispatchHelper.java:76)
at org.objectstyle.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:182)
As it turned out Hessian serializes Floats as Doubles... Will have to add a custom handler. |
Show » |
|
http://objectstyle.org/cayenne/lists/cayenne-devel/2006/07/0200.html
http://objectstyle.org/cayenne/lists/cayenne-devel/2006/07/0211.html
So looks like the problem is on deserializing GraphDiff on commit. GraphDiff is a generic structure, so hessian can't tell that double has to be narrowed back to Float, and the diff is applied to a CayenneDataObject, that is a map and doesn't care.