读书人

flex多模块加载时导致对象不正确序列化

发布时间: 2012-07-23 09:42:19 作者: rapoo

flex多模块加载时导致对象不正确序列化的解决办法

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">
  

读书人网 >flex

热点推荐