Hi Jeremy,

Did you have the original problem with multi-part forms on Tomcat 3 ?

I wasn't sure if the problem occured on Tomcat 3.x as it looks like all the
people reporting the problem are using a Servlet 2.3 implementation (3.x is
Servlet 2.2).  I'm not sure why this is the case, but I do know when we
moved from 3.3 of Tomcat to 4.0 we had to replace a lot of calls to
deprecated methods specifically to do with URL handling on the Servlet
Request objects, so maybe it has something to do with this being
restructured...(only a guess)

re. your tag - ensure you don't have an end tag '/>' on your form tag as
this ends the form without the form actually starting - ie.

<html:form action="xxxx" enctype="multipart/form-data"/> will blow up - you
need

<html:form action="xxxx" enctype="multipart/form-data">
....input fields, including <html:file .../>
</html:form>

On non-multipart forms having the /> on the form tag usually gives you a
wierd error message about field name 'xxx' cannot be found in
org.apache.struts.action.BEAN or something equivalent - I'm not sure how
this manifests itself in a multi-part form.

Regards,
Don
-----Original Message-----
From: Jeremy Prellwitz [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 25 May 2002 1:07 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: File upload failure in struts 1.1b - FIX


I tried this patch with Tomcat 3.3.1, and all i did was add:
enctype="multipart/form-data" to the <html:form /> element,
and then i got the following exceptions:

javax.servlet.ServletException: Multipart data doesn't start
with boundary
        at
org.apache.struts.upload.DiskMultipartRequestHandler.handleReq
uest(DiskMultipartRequestHandler.java:103)
        at org.apache.struts.util.RequestUtils.populate
(RequestUtils.java:908)
        at
org.apache.struts.action.RequestProcessor.processPopulate
(RequestProcessor.java:795)
        at org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:244)
        at org.apache.struts.action.ActionServlet.process
(ActionServlet.java:1110)
        at org.apache.struts.action.ActionServlet.doPost
(ActionServlet.java:470)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java)
        at org.apache.tomcat.facade.ServletHandler.doService
(ServletHandler.java:574)
        at org.apache.tomcat.core.Handler.invoke
(Handler.java:322)
        at org.apache.tomcat.core.Handler.service
(Handler.java:235)
        at org.apache.tomcat.facade.ServletHandler.service
(ServletHandler.java:485)
        at
org.apache.tomcat.facade.RequestDispatcherImpl.doForward
(RequestDispatcherImpl.java:272)
        at
org.apache.tomcat.facade.RequestDispatcherImpl.forward
(RequestDispatcherImpl.java:174)
        at org.apache.struts.action.RequestProcessor.doForward
(RequestProcessor.java:976)
        at
org.apache.struts.action.RequestProcessor.processActionForward
(RequestProcessor.java:408)
        at org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:269)
        at org.apache.struts.action.ActionServlet.process
(ActionServlet.java:1110)
        at org.apache.struts.action.ActionServlet.doPost
(ActionServlet.java:470)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java)
        at org.apache.tomcat.facade.ServletHandler.doService
(ServletHandler.java:574)
        at org.apache.tomcat.core.Handler.invoke
(Handler.java:322)
        at org.apache.tomcat.core.Handler.service
(Handler.java:235)
        at org.apache.tomcat.facade.ServletHandler.service
(ServletHandler.java:485)
        at
org.apache.tomcat.core.ContextManager.internalService
(ContextManager.java:917)
        at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:833)
        at
org.apache.tomcat.modules.server.Http10Interceptor.processConn
ection(Http10Interceptor.java:176)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:494)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:516)
        at java.lang.Thread.run(Thread.java:479)
Root cause:
java.io.IOException: Multipart data doesn't start with
boundary
        at
org.apache.struts.upload.MultipartBoundaryInputStream.readFirs
tElement(MultipartBoundaryInputStream.java:348)
        at
org.apache.struts.upload.MultipartBoundaryInputStream.setInput
Stream(MultipartBoundaryInputStream.java:172)
        at
org.apache.struts.upload.MultipartIterator.parseRequest
(MultipartIterator.java:202)
        at org.apache.struts.upload.MultipartIterator.
(MultipartIterator.java:171)
        at
org.apache.struts.upload.DiskMultipartRequestHandler.handleReq
uest(DiskMultipartRequestHandler.java:75)
        at org.apache.struts.util.RequestUtils.populate
(RequestUtils.java:908)
        at
org.apache.struts.action.RequestProcessor.processPopulate
(RequestProcessor.java:795)
        at org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:244)
        at org.apache.struts.action.ActionServlet.process
(ActionServlet.java:1110)
        at org.apache.struts.action.ActionServlet.doPost
(ActionServlet.java:470)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java)
        at org.apache.tomcat.facade.ServletHandler.doService
(ServletHandler.java:574)
        at org.apache.tomcat.core.Handler.invoke
(Handler.java:322)
        at org.apache.tomcat.core.Handler.service
(Handler.java:235)
        at org.apache.tomcat.facade.ServletHandler.service
(ServletHandler.java:485)
        at
org.apache.tomcat.facade.RequestDispatcherImpl.doForward
(RequestDispatcherImpl.java:272)
        at
org.apache.tomcat.facade.RequestDispatcherImpl.forward
(RequestDispatcherImpl.java:174)
        at org.apache.struts.action.RequestProcessor.doForward
(RequestProcessor.java:976)
        at
org.apache.struts.action.RequestProcessor.processActionForward
(RequestProcessor.java:408)
        at org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:269)
        at org.apache.struts.action.ActionServlet.process
(ActionServlet.java:1110)
        at org.apache.struts.action.ActionServlet.doPost
(ActionServlet.java:470)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java)
        at org.apache.tomcat.facade.ServletHandler.doService
(ServletHandler.java:574)
        at org.apache.tomcat.core.Handler.invoke
(Handler.java:322)
        at org.apache.tomcat.core.Handler.service
(Handler.java:235)
        at org.apache.tomcat.facade.ServletHandler.service
(ServletHandler.java:485)
        at
org.apache.tomcat.core.ContextManager.internalService
(ContextManager.java:917)
        at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:833)
        at
org.apache.tomcat.modules.server.Http10Interceptor.processConn
ection(Http10Interceptor.java:176)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:494)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:516)
        at java.lang.Thread.run(Thread.java:479)

If you think your patched jar would act differently, i would
love to try it!

Thanks.

Jeremy



---- Original message ----
>Date: Fri, 24 May 2002 11:19:30 +1000
>From: "Don Elliott" <[EMAIL PROTECTED]>
>Subject: File upload failure in struts 1.1b - FIX
>To: <[EMAIL PROTECTED]>, <struts-
[EMAIL PROTECTED]>
>
>Hi Struts Users / Developers,
>
>I've noticed a lot of posts about this in the archive,
particularly with
>WebLogic 6.1 - we have also experienced the file upload
crash in Servlet 2.3
>on Tomcat 4.0.3 for Solaris
>
>The fix is as follows:
>
>In package "org.apache.struts.action"
class "RequestProcessor" method
>"doForward(...)" add the follwing code as the first lines:
>
>if (request instanceof MultipartRequestWrapper) {
>            request = ((MultipartRequestWrapper)
request).getRequest();
>}
>
>I've noticed that this doesn't have any priority in the fix
list (are many
>people using this ?) - If anyone is interested I can send
them a patched
>struts1.1b1.jar file or the RequestProcessor.class file
until this fix is
>made in the nightlys..
>
>(I'll batch up all requests for the .jar file daily to save
my transfer
>costs).
>
>Regards,
>Don Elliott
>e.  [EMAIL PROTECTED]
>
>
>--
>To unsubscribe, e-mail:   <mailto:struts-user-
[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:struts-user-
[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to