2016-01-29 201 views
0

我在使用SOAP WebServices時遇到了一個非常奇怪的錯誤。奇怪這這裏,客戶端正常工作對測試服務器,但對生產服務器嘗試時,失敗與讀超時:奇怪的Apache CXF客戶端錯誤

[com.ctc.wstx.exc.WstxLazyException] Read timed out 

什麼是甚至奇怪的是,同樣的SOAP客戶端代碼當我的本地機器運行在生產SOAP WebService服務器上運行時,我的生產基礎非常好。只有在我們的生產客戶端環境中,生產SOAP WebService服務器纔會失敗並出現此異常。我完全無能爲力,我一直在努力在過去的4個小時裏與我的一位網絡同事解決這個問題的根源,但沒有成功。任何線索?

我正在使用Apache CXF!

回答

0

這是一個很難解決的問題。下面是我得到的異常:

Caused by: com.ctc.wstx.exc.WstxIOException: Read timed out 
    at com.ctc.wstx.sr.StreamScanner.constructFromIOE(StreamScanner.java:633) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1007) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.sr.BasicStreamReader.readTextSecondary(BasicStreamReader.java:4647) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.sr.BasicStreamReader.finishToken(BasicStreamReader.java:3722) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken(BasicStreamReader.java:3676) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    ... 39 common frames omitted 
Caused by: java.net.SocketTimeoutException: Read timed out 
    at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.7.0_51] 
    at java.net.SocketInputStream.read(SocketInputStream.java:152) ~[na:1.7.0_51] 
    at java.net.SocketInputStream.read(SocketInputStream.java:122) ~[na:1.7.0_51] 
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) ~[na:1.7.0_51] 
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) ~[na:1.7.0_51] 
    at java.io.BufferedInputStream.read(BufferedInputStream.java:334) ~[na:1.7.0_51] 
    at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:552) ~[na:1.7.0_51] 
    at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609) ~[na:1.7.0_51] 
    at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:696) ~[na:1.7.0_51] 
    at java.io.FilterInputStream.read(FilterInputStream.java:133) ~[na:1.7.0_51] 
    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3053) ~[na:1.7.0_51] 
    at com.ctc.wstx.io.BaseReader.readBytes(BaseReader.java:155) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.io.UTF8Reader.loadMore(UTF8Reader.java:368) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:111) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.io.MergedReader.read(MergedReader.java:105) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:86) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:56) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1001) ~[org.codehaus.woodstox.woodstox-core-asl-4.4.1.jar:4.4.1] 
    ... 42 common frames omitted 

請記住,WstxIOException指向應用程序不能夠解析傳入的SOAP消息。在我們的例子中,SOAP消息是由服務器分塊發送的,我們的應用程序沒有收到所有的塊。有一些網絡防火牆丟棄了一些大於1024kb的數據包。這發生在tcp級別。

只要我們的網絡人員增加了傳入數據包的大小,它就立即開始工作!