建立Flex4与Java项目时,出现如下错误:
[quote]Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080//WebContent/messagebroker/amf'[/quote]
或者
[quote][FaultEvent fault=[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/WebContent/messagebroker/amf'"] messageId="C25D6E12-4A22-9827-849A-C56BBBB434F4" type="fault" bubbles=false cancelable=true eventPhase=2] [/quote]
解决方案如下:
此处一定要有endpoint的属性,后面的值可参照上面的错误的URL,但要将其WebContent 改为你的项目名称.也就是Context root(输出文件夹)
然后右击你的项目名称--->Properties--->Flex Server(Flex服务器)-->Context root(输出文件夹)设置为FlexDemo,也就是你的项目名称。
参考http://zylucky.iteye.com/blog/405642
[quote]Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080//WebContent/messagebroker/amf'[/quote]
或者
[quote][FaultEvent fault=[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/WebContent/messagebroker/amf'"] messageId="C25D6E12-4A22-9827-849A-C56BBBB434F4" type="fault" bubbles=false cancelable=true eventPhase=2] [/quote]
解决方案如下:
<mx:RemoteObject id="firstRO" destination="Flexweb" fault="faultEvent(event)"
endpoint="http://localhost:8080/FlexDemo/messagebroker/amf"/>
此处一定要有endpoint的属性,后面的值可参照上面的错误的URL,但要将其WebContent 改为你的项目名称.也就是Context root(输出文件夹)
然后右击你的项目名称--->Properties--->Flex Server(Flex服务器)-->Context root(输出文件夹)设置为FlexDemo,也就是你的项目名称。
参考http://zylucky.iteye.com/blog/405642