简体   繁体   English

无法解析多部分请求org.apache.commons.fileupload.FileUploadException:处理多部分/表单数据请求失败。 空值

[英]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.

相关问题 org.apache.commons.fileupload.FileUploadException:处理多部分/表单数据请求失败 - org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed 春季-AngularJS-文件上传-org.apache.commons.fileupload.FileUploadException:由于未找到多部分边界,请求被拒绝 - Spring - AngularJS - File Upload - org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found 它不起作用! 处理多部分/表单数据请求失败。 套接字上意外的EOF读取 - Its not working!! Processing of multipart/form-data request failed. Unexpected EOF read on the socket 处理multipart / form-data请求失败。读取超时 - Processing of multipart/form-data request failed. Read timed out 异常multipart / form-data请求失败。 读取超时 - Exception multipart/form-data request failed. Read timed out Spring MVC - AngularJS - 文件上传 - org.apache.commons.fileupload.FileUploadException - Spring MVC - AngularJS - File Upload - org.apache.commons.fileupload.FileUploadException 是否不建议使用Commons FileUpload处理多部分/表单数据? - Is use of Commons FileUpload to handle multipart/form-data not deprecated? 处理 multipart/form-data 请求时,srpingboot 1.3.7 中的文件始终为 null - File is always null in srpingboot 1.3.7 when processing multipart/form-data request 在Java中解析包含multipart / form-data请求体的String - Parse a String containing multipart/form-data request body in Java 具有Multipart / Form-Data Enctype的表单验证失败后,Struts 1丢失请求参数 - Struts 1 Losing Request Parameters after Failed Form Validation with Multipart/Form-Data Enctype
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM