[英]Failed to parse multipart request org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. null
I know the similar questions are already asked, but unfortunately I can't find the good answer to find the solution for this problem. 我知道已经问过类似的问题,但是不幸的是,我找不到合适的答案来找到该问题的解决方案。 When I try to upload any file (XML/CSV formats accepted only), it works in local, but on the server it doesn't work. 当我尝试上载任何文件(仅接受XML / CSV格式)时,它在本地运行,但在服务器上不起作用。 I don't have any timeout or read timeout error. 我没有任何超时或读取超时错误。 Here you can find more details. 在这里您可以找到更多详细信息。
IMPORTANT : I have this error after correction of Hibernate Session's error, in fact I had always Session Close error in log file so I changed my code and now the Sessions will be closed after finishing the task, but I have this new error only in Server and not in LOCAL !! 重要说明:纠正了Hibernate Session的错误后,我遇到了此错误,实际上我在日志文件中始终存在Session Close的错误,因此我更改了代码,现在完成任务后将关闭Sessions,但是只有在Server中才有此新错误而不是在本地!
Server log : 服务器日志:
ERROR [org.apache.struts.upload.CommonsMultipartRequestHandler] (ajp-127.0.0.1-8009-6) Failed to parse multipart request
org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. null
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384)
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:182)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:389)
at org.apache.struts.chain.commands.servlet.PopulateActionForm.populate(PopulateActionForm.java:45)
at org.apache.struts.chain.commands.AbstractPopulateActionForm.execute(AbstractPopulateActionForm.java:57)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
Server.xml file : Server.xml文件:
<Service name="jboss.web">
<!-- A HTTP/1.1 Connector on port 8080 -->
<Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
connectionTimeout="20000" redirectPort="8443" />
I'm assuming that you are uploading a big file and it's taking time to upload. 我假设您正在上传一个大文件,并且要花一些时间才能上传。
I would suggest to add the following to Connector
with the following: 我建议将以下内容添加到Connector
:
<!-- A HTTP/1.1 Connector on port 8080 -->
<Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
connectionTimeout="60000" redirectPort="8443"
connectionUploadTimeout="36000000" disableUploadTimeout="false" />
(See this related SO Question ). (请参阅此相关的SO问题 )。
I hope this helps. 我希望这有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.