Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes problem while posting data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem while posting data" Watch "problem while posting data" New topic
Author

problem while posting data

Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
We are using WAS 4 with IBM HTTP Server. I have serialised a object and saved in a file.I am not able to upload this file to database through POST.
I am using MultipartParser from com.oreilly.servlet.
The concern here is I was able to upload files less than 15MB earlier. I increased the upper limit to 25 MB and tried to upload 25 MB file and it fails. Another part is, the upload happens fine when done from websphere test environment (WSAD, websphere appln development)i.e locally, but not happen in production environment.

Is this due to
1) Network traffic
2) Upper limit set on POST content (in HTTP Server)
3) any other reason??

here is the error.

java.io.IOException: Corrupt form data: premature ending
at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:166)
at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:94)
at mypackage.servlets.dev.Saver.doPost(Saver.java:52)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java(Inlined Compiled Code))
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:144)

Sometimes I get a different error and that is

java.io.IOException: unexpected end of part
at com.oreilly.servlet.multipart.PartInputStream.fill(PartInputStream.java(Compiled Code))
at com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readFullyInternal(ObjectInputStream.java(Inlined Compiled Code))
at java.io.ObjectInputStream.bufferData(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readInt(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.inputArray(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
Faris A Saduli
Ranch Hand

Joined: Feb 22, 2005
Posts: 58
You posted bulk data so there is reduction in network efficience cause this problem.
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
Here is more information.

I was able to install WAS on local system(win xp) and upload the 25 MB file to DB. local WAS version is 4.0.6. local IBM HTTP Server version is 1.3.19
I was not able to upload in the live environment(i.e AIX 5, WAS 4.0.6)

So my guesses are
1) The servicepack for WAS or HTTP server could be an issue
2) There is some additional setting in WAS which I dont have in locally installed WAS.

Any help will be greatly appreciated.

Thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem while posting data