发送消息时'严重:SAAJ0009:消息发送失败错误'

时间:2011-02-08 06:39:32

标签: java soap jaas

Feb 8, 2011 11:56:49 AM com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPC
onnection post
SEVERE: SAAJ0009: Message send failed
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedA
ctionException: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message s
end failed
        at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.cal
l(Unknown Source)
        at external.main(external.java:47)
Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.messagi
ng.saaj.SOAPExceptionImpl: Message send failed
        at java.security.AccessController.doPrivileged(Native Method)
        ... 2 more
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send f
ailed
        at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.pos
t(Unknown Source)
        at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection$Pri
viledgedPost.run(Unknown Source)
        ... 3 more
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.<init>(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
        at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown S
ource)
        ... 5 more

CAUSE:

java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOA
PExceptionImpl: Message send failed
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.cal
l(Unknown Source)
        at external.main(external.java:47)
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send f
ailed
        at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.pos
t(Unknown Source)
        at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection$Pri
viledgedPost.run(Unknown Source)
        ... 3 more
Caused by: java.net.ConnectException: Connection timed out: connect    
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.<init>(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
        at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown S
ource)
        ... 5 more

CAUSE:


java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOA
PExceptionImpl: Message send failed
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.cal
l(Unknown Source)
        at external.main(external.java:47)
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send f
ailed
        at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.pos
t(Unknown Source)
        at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection$Pri
viledgedPost.run(Unknown Source)
        ... 3 more
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.<init>(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
        at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown S
ource)
        ... 5 more
java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOA
PExceptionImpl: Message send failed

2 个答案:

答案 0 :(得分:8)

出现PROXY问题时会出现上述问题。 有两种方法可以解决这个问题。 在创建SOAP Envelope和调用Web服务时,我遇到了同样的问题。 当我尝试测试我的代码从SOAP-UI客户端创建的请求时,它工作得非常好,因为我设置了代理,用户名&amp;密码。 但是当我试图通过从Eclipse代码本身调用Web服务来获取响应时,这对我来说不起作用。 我还尝试在Eclipse中的“网络连接”选项卡中设置代理对象。 为此,我将原始设置更改为Native to Manual&amp;只需添加我的代理,用户名和&amp;密码。 但不幸的是,这对我也没有用。 然后,我只需添加一行代码即可在我的代码和代码中选择系统集代理。这解决了我的问题。 你必须添加:System.setProperty(&#34; java.net.useSystemProxies&#34;,&#34; true&#34;); 这将简单地选择代码中的系统集代理。会很好的。 如果这也不起作用,您的请求对象肯定会遇到一些问题。

答案 1 :(得分:0)

例外说:

  

引起:java.net.ConnectException:连接超时:连接

您尝试访问WebService的URL无法从您的计算机访问。 通过ping双重检查,是否有任何代理设置,防火墙。 ..等