Flex在调用java端方法的时候如果输入参数是java对象就需要序列化,但是当模块切换时如果不同模块使用不同的对象就会导致切换时序列化失败。
它的原因就是在flex的ModuleLoader内部和外部模块域不同导致序列化失败。
错误信息如下:
[RPC Fault faultString="Cannot invoke method 'methodA'." faultCode="Server.ResourceUnavailable" faultDetail="The expected argument types are (com.bizint.agent.model.Staff) but the supplied types were (flex.messaging.io.amf.ASObject) and converted to (null)."]
解决方法:
设置ModuleLoader的applicationDomain属性为当前的applicationDomain:
modualLoader.applicationDomain=ApplicationDomain.currentDomain;
它的原因就是在flex的ModuleLoader内部和外部模块域不同导致序列化失败。
错误信息如下:
[RPC Fault faultString="Cannot invoke method 'methodA'." faultCode="Server.ResourceUnavailable" faultDetail="The expected argument types are (com.bizint.agent.model.Staff) but the supplied types were (flex.messaging.io.amf.ASObject) and converted to (null)."]
解决方法:
设置ModuleLoader的applicationDomain属性为当前的applicationDomain:
modualLoader.applicationDomain=ApplicationDomain.currentDomain;
Flex序列化问题解决
本文介绍了Flex在调用Java端方法时遇到的序列化失败问题及其解决方案。问题出现在不同模块使用了不同对象的情况下,导致ModuleLoader内外模块域不一致而引发序列化错误。通过设置ModuleLoader的applicationDomain属性为当前的applicationDomain可以有效解决此问题。
53

被折叠的 条评论
为什么被折叠?



