BlazeDs Java 对象的序列化
我有一些实现序列化的Java类,以及实现IExternalized的相应AS对象(由GAS自行生成)。
从服务器接收对象没有问题,但是当我尝试将对象发送到服务器时 - 它抛出异常:
[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.
真的我必须实现Externalized才能将对象发送到Java服务器吗?!
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?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,我不必实现Externalized,甚至不必实现Serialized。
相反,我只需在 Flex 方面指定它是一个远程类,其别名指向完整的 java 类路径。我还应该确保属性名称(或 getter 和 setter)等于 java 对象属性名称。最后,我应该确保对象/属性类型匹配或转换良好(数字 java 对象到 Flex 中的 Number 等)。
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.).
您必须实现可外部化。
请参阅http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WSc3ff6d0ea77859461172e0811f00f6eab8-7ffdUpdate.html
在 ActionScript 和 Java 之间使用自定义序列化
如果序列化和反序列化数据的标准机制客户端上的ActionScript和服务器上的Java不能满足您的需求,您可以编写自己的序列化方案。您在客户端上实现基于 ActionScript 的 flash.utils.IExternalizable 接口,并在服务器上实现相应的基于 Java 的 java.io.Externalizable 接口。
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.