Tomcat管理器:无法上载大型WAR文件

时间:2019-06-12 21:31:08

标签: java apache amazon-web-services tomcat8

尝试使用Tomcat管理器部署应用程序时出现异常。管理器无法上传文件。我的战争档案大小为85 MB。但是对于小的战争档案,管理器可以正常工作。我尝试使用“ Hello World”应用程序(大小为5 KB),并且运行良好。 我在经理的web.xml中增加了max-file-size,并且还尝试在server.xml中增加了connectionTimeout。但是没有任何帮助。

这是个例外。

SEVERE [ajp-nio-8009-exec-4] org.apache.catalina.core.ApplicationContext.log HTMLManager: FAIL - Deploy Upload Failed, Exception: [org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Proc
essing of multipart/form-data request failed. null]
 java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. null
        at org.apache.catalina.connector.Request.parseParts(Request.java:2950)
        at org.apache.catalina.connector.Request.parseParameters(Request.java:3242)
        at org.apache.catalina.connector.Request.getParameter(Request.java:1136)
        at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381)
        at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:108)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:479)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. null
        at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:297)
        at org.apache.catalina.connector.Request.parseParts(Request.java:2902)
        ... 29 more
Caused by: java.io.EOFException
        at org.apache.coyote.ajp.AjpProcessor.read(AjpProcessor.java:1279)
        at org.apache.coyote.ajp.AjpProcessor.readMessage(AjpProcessor.java:618)
        at org.apache.coyote.ajp.AjpProcessor.receive(AjpProcessor.java:580)
        at org.apache.coyote.ajp.AjpProcessor.refillReadBuffer(AjpProcessor.java:688)
        at org.apache.coyote.ajp.AjpProcessor$SocketInputBuffer.doRead(AjpProcessor.java:1390)
        at org.apache.coyote.Request.doRead(Request.java:581)
        at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:343)
        at org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:659)
        at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:366)
        at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:183)
        at java.io.FilterInputStream.read(FilterInputStream.java:133)
        at org.apache.tomcat.util.http.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:132)

1 个答案:

答案 0 :(得分:1)

转到管理器应用程序的web.xml(/tomcat/webapps/manager/WEB-INF/web.xml)。

增大max-file-size和max-request-size

<multipart-config>
  <!-- 50MB max -->
  <max-file-size>52428800</max-file-size>
  <max-request-size>52428800</max-request-size>
  <file-size-threshold>0</file-size-threshold>
</multipart-config>