`
fatherican
  • 浏览: 48246 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

RPC Fault faultString="Cannot invoke method 'helloWorld'." faultCode="Server.ResourceUnavailable" fa

 
阅读更多


flex端.mxml代码

remoteObject的定义

<mx:RemoteObject id="pn" destination="plan">
<mx:method name='helloWorld' result="handler(event)"/>
</mx:RemoteObject>

在上面的name属性里面的方法要和Java端定义的方法同名

如:name='helloWorld' 那么在Java端同样有一个helloWorld的方法,否则在flex端调用helloWorld的时候,中间层不知道到底调用Java端的那个方法。


在flex文件夹的remoting_config.xml文件中一定要有定义好的中间层的配置

<destination id="plan">
<properties>
<source>com.flex.(此处是Java端的类名)</source>
</properties>
</destination>


当调用后如果出现:

[RPC Fault faultString="Cannot invoke method 'helloWorld'." faultCode="Server.ResourceUnavailable" faultDetail="Method 'helloWorld' not found."]

可能的原因是:

1.配置的路径不对

2.在Java端的helloWorld方法的属性是是private,应该改成public才可以。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics