简体   繁体   中英

BlazeDs serialization of Java objects

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?!

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.).

You must implement Externalizable.

See http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WSc3ff6d0ea77859461172e0811f00f6eab8-7ffdUpdate.html

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM