2011-02-08 260 views
3
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 

回答

0

異常說:

引起:java.net.ConnectException:連接超時:接

的您嘗試訪問WebService的URL無法從您的機器訪問。 通過ping進行雙重檢查,是否有任何代理設置,防火牆。 ..等等。

+0

亞iam工作在代理後面...所以我應該怎麼做來克服代理..?或者如何配置代理在jaas ..? – prathyush 2011-02-08 11:33:59

+0

快速文章http://www.rgagnon.com/javadetails/java-0085.html – 2011-02-08 11:35:48

8

當發生PROXY問題時,會發生上述問題。 有兩種方法可以解決這個問題。 我在創建SOAP信封並調用Web服務時遇到了同樣的問題。 當我嘗試測試由SOAP-UI客戶端的代碼創建的這個請求時,它工作得很好,因爲我已經設置了代理,用戶名爲&,密碼。 但是當我試圖通過從Eclipse代碼本身調用Web服務來獲取響應時,這對我並不適用。 我還嘗試在Eclipse的「網絡連接」選項卡中設置代理對象。 爲此,我將原始設置從手動&更改爲初始設置,只需添加我的代理,用戶名爲&的密碼。 但不幸的是,這也沒有爲我工作。 然後,我簡單地添加了1行代碼,在我的代碼&中提取系統設置代理,這已經解決了我的問題。 您必須添加:System.setProperty(「java.net.useSystemProxies」,「true」); 這將簡單地拿起您的代碼內的系統設置代理&將正常工作。 如果這也不起作用,請求對象肯定有問題。