Xfire Nested exception is org.codehaus.xfire.fault.XFireFault:Couldn't send message.

org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Couldn't send message.
org.codehaus.xfire.fault.XFireFault: Couldn't send message.
at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:30)

at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.Java:131)


使用xfire製作完webservice 接口時,使用 http://localhost:8080/webservice/services/demo?wsdl 能訪問到,

但是在調用的過程中連接不到接口服務器。

後面使用ip訪問發現訪問不到這個鏈接。

解決方法:

1. 使用cmd命令netstat -n, 查看tomcat地址綁定, 發現是綁定到::1, IPv6.

2. 配置tomcat的server.xml, 更改connector配置, 端口不用改, 加上address="0.0.0.0", 使其綁定到IPv4, 如下

(借鑑的解決方案)
<1>使用cmd命令netstat -n, 查看tomcat地址綁定, 發現是綁定到::1, IPv6;
<2> 配置tomcat的server.xml, 更改connector配置, 端口不用改, 加上address="0.0.0.0", 使其綁定到IPv4
<Connector port="8080" maxHttpHeaderSize="8192" address="0.0.0.0"maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"connectionTimeout="20000" disableUploadTimeout="true" />
<3>重啓tomcat, 再次使用netstat -n, 查看tomcat地址綁定, 已變爲IPv4.

此問題即可迎刃而解。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章