[RPC Fault faultString="Send failed"faultCode="Client.Error.MessageSend"faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed:HTTP: Status 404:
url: 'http://localhost:8080/WebRoot/messagebroker/amf'"]
当我看到url时发现工程名是'FirstFlex',但信息提示成了WebRoot,故在工程属性对话框-->Flex Server中的
Root Url -->http://localhost:8080/FirstFlex
Context Root-->WebRoot 故把WebRoot改成'FirstFlex',重新编译运行即可。
原因是myeclipse没有把用户某些设置更新过去。
学学Flex与Java的交互:
(3)现在,我们要定义remote object,让flex程序能够调用java类。首先来配置/WEB-INF/flex/remoting-config.xml文件,添加以下粗体部分来新增一个destionation—HelloWorld类。
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
<destination id="helloworld">
<properties>
<source>hello.HelloWorld</source>
</properties>
</destination>
</service>