[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultD

在flex+java的時候,運行出現這種錯誤:

[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8889/WebRoot/messagebroker/amf'"]


解決辦法:
1:
最簡單的
在<mx:RemoteObject> 裏面的屬性加上

endpoint="http://localhost:8889/testApp/messagebroker/amf"


2:

[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時發現工程名是'a',但信息提示成了WebRoot,故在工程屬性對話框-->Flex Server中的
Root Url -->http://localhost:8080/a
Context Root-->WebRoot 故把WebRoot改成'a',重新編譯運行即可。
原因是myeclipse沒有把用戶某些設置更新過去。


3:

[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8089/cargps/messagebroker/amf'"]

自己的解決:tomcat配置的虛擬目錄錯誤:
在Tomcat\conf目錄下,打開server.xml,在</Host> 之前加上
<Context path="/pro" docBase="工程本地路徑\工程名\WebRoot" debug="0" reloadable="true" crossContext="true">
</Context>

path 表示在瀏覽器中輸入http://localhost:8080/pro
docBase表示你的程序包的物理絕對路徑,默認的絕對路徑是$Tomcat_Home$/webapps
發佈了73 篇原創文章 · 獲贊 0 · 訪問量 5980
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章