当前位置:  开发笔记 > 编程语言 > 正文

javax.xml.ws.WebServiceException:java.io.IOException:写入服务器Tomcat 8时出错

如何解决《javax.xml.ws.WebServiceException:java.io.IOException:写入服务器Tomcat8时出错》经验,为你挑选了0个好方法。

我们最近将在JRE 1.7.0_17/Tomcat7.0.39上运行的JAX-WS Web服务的技术堆栈更新为JRE 1.8.0_66/Tomcat 8.0.28.Web应用程序在Windows Server 2012上运行.Web服务使用Metro实现JAX-WS.客户端使用JRE 7和JRE中内置的JAX-WS客户端API在各种Windows版本上运行.Web服务用于将文件从客户端计算机上载到Web服务,将Web服务保存在文档管理系统中.在Java 7/Tomcat 7下,实现工作非常完美,但我们遇到了在Java 8/Tomcat 8服务器端运行的更大负载(2MB或更大)的问题.来自客户端的堆栈跟踪是:

12/02/2015 14:12:38.699 [AWT-EventQueue-0] ERROR  DocumentImporterMainWindow$SwingAction.importDocument: Unexpected Problem trying to call the CustomerOrderDMService
javax.xml.ws.WebServiceException: java.io.IOException: Error writing to server
    at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.readResponseCodeAndMessage(Unknown Source)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(Unknown Source)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
    at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
    at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
    at com.sun.proxy.$Proxy30.importDocument(Unknown Source)
    at com.mycompany.documentimporter.DocumentImporterMainWindow$SwingAction.importDocument(DocumentImporterMainWindow.java:681)
    at com.mycompany.documentimporter.DocumentImporterMainWindow$SwingAction.actionPerformed(DocumentImporterMainWindow.java:612)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.IOException: Error writing to server
    at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    ... 54 more

遗憾的是,在任何tomcat日志中都没有记录服务器端.我花了几天时间寻找问题的解决方案而没有成功.我试图通过各种途径调试问题,例如使用-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true(客户端)和-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true(服务器)java系统属性记录SOAP请求/响应客户端和服务器 端, 但是当错误发生时,仅记录客户端请求:

---[HTTP request - http://localhost:8080/CustomerOrderDM/services/CustomerOrderDMService]---
Accept: text/xml, multipart/related
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.mycompany.com/CustomerOrderDMService/ImportDocument"
User-Agent: JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e
A000049STOCKEmail **some base64 encoded byte[] of the file contents being uploaded**

Message has been truncated
use com.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold property to increase the amount of printed part of the message
--------------------

由于只记录了客户端请求,我们预计服务器没有完全处理请求,并且它正在落入某种异常块,但是没有任何记录到服务器日志文件的任何内容,我们在解决问题时遇到了困难.

我们已经尝试使用代理,例如Eclipse中内置的监控,但我再次只看到来自客户端的请求而没有来自服务器的响应(当客户端发送更大的请求失败时,小请求在两个客户端上请求日志请求/响应和服务器).其他调试建议将不胜感激.

我们还尝试了Java和Tomcat的不同组合:

Tomcat 7/Java 7 =正常工作

Tomcat 7/Java 8 =正常工作

Tomcat 8/Java 7 =不起作用

Tomcat 8/Java 8 =不起作用

这导致我们认为问题出在Tomcat 8上.在Tomcat 8中改变了一些东西,我们现在需要设置一些新的超时/有效负载设置,或者Tomcat 8有一个与此特定问题相关的错误.

我们已经尝试设置一些如Tomcat连接设置maxPostSize="-1",connectionTimeout="-1",disableUploadTimeout="true",connectionUploadTimeout="-1",keepAliveTimeout="-1" 但这些都不工作,真的觉得像在黑暗中拍摄不知道什么是在服务器端去.

我们已经尝试将Metro jars服务器端更新到最新版本(jaxws-ri-2.2.10)以及使用Java 8运行客户端.不幸的是,这些都不起作用.任何帮助将不胜感激.

推荐阅读
wurtjq
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有