profskz
profskz

Reputation: 209

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. 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 !!

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 :

 <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" />

Upvotes: 0

Views: 19587

Answers (1)

Buhake Sindi
Buhake Sindi

Reputation: 89169

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:

 <!-- 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).

I hope this helps.

Upvotes: 2

Related Questions