Reputation: 808
I have a few Java classes that implements Serialization, and corresponding AS objects (self-generated by GAS) that implements IExternalizable.
There is no problem receiving objects from the server, but when I try to send objects to the server - it throws an exception:
[BlazeDS]Class 'xxx' must implement java.io.Externalizable to receive client
IExternalizable instances. flex.messaging.io.SerializationException: Class 'xxx' must
implement java.io.Externalizable to receive client IExternalizable instances.
Really I must implement Externalizable to send objects to Java server?!
Upvotes: 0
Views: 3034
Reputation: 808
Actually, I don't have to implement Externalizable and even not Serializable. Instead I just have to specify, on the flex side that it is a remote class with alias that points to the full java class path. I should also make sure that the properties names (or getters and setters) are equal to the java object properties names. Finally, I should make sure that the object/properties types are matched or converted well (numeric java objects to Number in Flex etc.).
Upvotes: 1
Reputation: 2437
You must implement Externalizable.
Using custom serialization between ActionScript and Java
If the standard mechanisms for serializing and deserializing data between ActionScript on the client and Java on the server do not meet your needs, you can write your own serialization scheme. You implement the ActionScript-based flash.utils.IExternalizable interface on the client and the corresponding Java-based java.io.Externalizable interface on the server.
Upvotes: 0