Link to home
Create AccountLog in
Avatar of balatrue
balatrue

asked on

Processing of multipart/form-data request failed. Read timed out

Hi all,
         I can't upload a zip file into my prod server from the application, but i can successfully upload the same file in dev server. I am using Websphere 5.1 .I guess there is some issue between client- server communication. I am getting fileupload expection and read timed out.
Could you please provide me some solution to fix this issue


Thanks
Bala


   
Avatar of bluebelldiscovery
bluebelldiscovery
Flag of Singapore image

"I am getting fileupload expection and read timed out"

Can you paste the fileupload exception?
Avatar of balatrue
balatrue

ASKER

Hi blue,
            This is waht i am getting

WebGroup      E SRVE0026E: [Servlet Error]-[Processing of multipart/form-data request failed. Read timed out]: org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Read timed out
      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:359)
      at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
      at com.aigaa.pmw.controllers.ExtendedMultiPartRequestHandler.handleRequest(ExtendedMultiPartRequestHandler.java:213)
      at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:442)
      at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:816)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1075)
      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:583)
      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:211)
      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:139)
      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:332)
      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:255)
      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:657)
      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:463)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937)
Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at com.ibm.ws.io.Stream.read(Stream.java:17)
      at com.ibm.ws.io.ReadStream.read(ReadStream.java:181)
      at com.ibm.ws.http.ContentLengthInputStream.read(ContentLengthInputStream.java:48)
      at com.ibm.ws.io.ReadStream.read(ReadStream.java:181)
      at com.ibm.ws.webcontainer.http.HttpConnection.read(HttpConnection.java:342)
      at com.ibm.ws.webcontainer.srp.SRPConnection.read(SRPConnection.java:200)
      at com.ibm.ws.webcontainer.srt.SRTInputStream.read(SRTInputStream.java:80)
      at com.ibm.ws.webcontainer.srt.http.HttpInputStream.read(HttpInputStream.java:312)
      at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:959)
      at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887)
      at java.io.InputStream.read(InputStream.java:89)
      at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94)
      at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)
      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:354)
      ... 28 more


Thanks
Bala
ASKER CERTIFIED SOLUTION
Avatar of bluebelldiscovery
bluebelldiscovery
Flag of Singapore image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Hi ,

This issue is in our prod, you know the default ConnectionIOTimeout is 5 second in Websphere, I want to recreate this issue in dev system, but the execution time for the method

upload.parseRequest(request); is just 1 second,
This method uploads a file from the disk to the server and it execute with in 1 second. But I want to increase the execution time say for example 5 second for testing purpose. How can do that.

 So could you please tell me how to increase the execution time for more than 4 seconds.

(Note:I will set  ConnectionIOTimeout = 1 in dev websphere box).
You can code a test client that do multipart/form-data request.

Here how.

Download ClientHttpRequest from Vlad Patryshev.
http://www.devx.com/assets/sourcecode/7315.zip

Look for the function boundary() then insert a delay as required
  private void boundary() throws IOException {
    write("--");
    /////// insert delay: is will delay the upload ///////
    try{Thread.sleep(5000);}catch(Exception e){}
    write(boundary);
  }


The code for the test client can be. (provided your application accept file)

public static void testDelayUpload(File file) throws Exception
{
  ClientHttpRequest client = new ClientHttpRequest("http://Websphereapp/request");
  client.setParameter("filename", file); // change parameter name here
  client.connect();
  client.post();
}
good