gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:24:49 25 4
gpt4 key购买 nike

我们最近将在 JRE 1.7.0_17/Tomcat7.0.39 上运行的 JAX-WS 网络服务的技术堆栈更新为 JRE 1.8.0_66/Tomcat 8.0.28。 Web 应用程序在 Windows Server 2012 上运行。Web 服务使用 JAX-WS 的 Metro 实现。客户端使用 JRE 7 和内置于 JRE 中的 JAX-WS 客户端 API 在各种 Windows 版本上运行。网络服务用于将文件从客户端机器上传到网络服务,网络服务将文件保存在文档管理系统中。该实现在 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 日志中都没有记录服务器端的内容。我花了几天时间寻找问题的解决方案,但没有成功。我尝试通过各种途径调试问题,例如使用记录 SOAP 请求/响应客户端和服务器端-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true(客户端)和-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true(服务器)java 系统属性,但发生错误时仅记录客户端请求:

---[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
<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns3:ImportDocumentRequestDTO xmlns:ns3="http://www.mycompany.com/CustomerOrderDMService/" xmlns:ns2="http://www.mycompany.com/CustomerOrderDMService"><ns2:QuoteNumber>A000049</ns2:QuoteNumber><ns2:SerialNumber>STOCK</ns2:SerialNumber><ns2:DocumentType>Email</ns2:DocumentType><ns2:Description></ns2:Description><ns2:DocumentContents> **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
--------------------

由于只有客户端请求被记录,我们预计服务器没有完全处理请求并且它正在陷入某种异常 block ,但是没有任何记录到服务器日志文件我们很难解决问题.

我们曾尝试使用代理,例如 Eclipse 中内置的 Monitoring,但我又一次只看到来自客户端的请求而没有来自服务器的响应(当客户端发送失败的较大请求时,小请求记录请求/响应在客户端和服务器上)。其他调试建议将不胜感激。

我们还尝试了 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 运行客户端。不幸的是,这些都不起作用。任何帮助将不胜感激。

最佳答案

原来是Tomcat 7.0.55包含了Fix:

CVE-2014-0230:
Add a new limit, defaulting to 2MB, for the amount of data Tomcat will swallow for an aborted upload. The limit is configurable by maxSwallowSize attribute of an HTTP connector.

通过在 <Connector> 上设置 maxSwallowSize="-1"设置解决了我的问题在 tomcat 服务器 server.xml 中配置。

我要感谢来自 Tomcat 用户邮件列表的 Mark Thomas 和 Chris Schultz 的帮助。有关如何加入邮件列表的说明,请单击 here .我还要感谢 Vinayak 指出我对 Tomcat 的支持。

关于javax.xml.ws.WebServiceException : java. io.IOException:写入服务器 Tomcat 8 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34053442/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com