flex多模块加载时导致对象不正确序列化的解决办法
2010年04月18日
Flex在调用java端方法的时候如果输入参数是java对象就需要序列化,但是当模块切换时如果不同模块使用不同的对象就会导致切换时序列化失败。
它的原因就是在flex的ModuleLoader内部和外部模块域不同导致序列化失败。
错误信息如下:
[RPC Fault faultString="Cannot invoke method 'findCondition'." faultCode="Server.ResourceUnavailable" faultDetail="The expected argument types are (com.cfkyit.framework.utils.FindConditionRs) but the supplied types were (flex.messaging.io.amf.ASObject) and converted to (null)."]
解决方法:
设置ModuleLoader的applicationDomain属性为当前的applicationDomain:
modualLoader.applicationDomain=ApplicationDomain.currentDomain;
或者:
applicationDomain="{ApplicationDomain.currentDomain}" x="10" y="39" width="859" height="251">
2010年04月18日
Flex在调用java端方法的时候如果输入参数是java对象就需要序列化,但是当模块切换时如果不同模块使用不同的对象就会导致切换时序列化失败。
它的原因就是在flex的ModuleLoader内部和外部模块域不同导致序列化失败。
错误信息如下:
[RPC Fault faultString="Cannot invoke method 'findCondition'." faultCode="Server.ResourceUnavailable" faultDetail="The expected argument types are (com.cfkyit.framework.utils.FindConditionRs) but the supplied types were (flex.messaging.io.amf.ASObject) and converted to (null)."]
解决方法:
设置ModuleLoader的applicationDomain属性为当前的applicationDomain:
modualLoader.applicationDomain=ApplicationDomain.currentDomain;
或者:
applicationDomain="{ApplicationDomain.currentDomain}" x="10" y="39" width="859" height="251">
本文介绍了Flex中因模块切换导致的对象序列化失败问题及其解决办法。通过设置ModuleLoader的applicationDomain属性为当前的applicationDomain,可以避免不同模块间对象序列化错误。
36

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



