[ http://mc4j.org/jira/browse/STS-235?page=comments#action_10402 ] 
            
Tim Fennell commented on STS-235:
---------------------------------

Hi,

I've been trying to reproduce this issue, and have been unable to do so in a 
simpler scenario. I've been modifying the Login.jsp page in the Stripes 
examples, setting the form to look like:
     <stripes:form action="/examples/bugzooky/Login.action" focus="" 
enctype="multipart/form-data">

This works in Camino/Safari/FireFox.  I even tried creating a form that would 
submit zero parameters (empty form, external button that calls form.submt()) 
and that worked fine too.

So I started looking at the stack trace you provided more closely, and I think 
this line is probably the cause of the problem:
    at 
info.magnolia.cms.filters.MultipartRequestFilter.doFilter(MultipartRequestFilter.java:80)
 

It looks like the problem isn't so much that there's no form data as that 
Magnolia has already consumed all the request data and wrapped the request in 
their own wrapper.  Unfortunately their wrapper still reports the encoding as 
multipart/form-data, and there is no way to tell whether the request stream has 
already been consumed or not :(

The best I can probably do is catch the IOException and check for that exact 
message .. but there's no guarantee that message wouldn't crop up in places 
where the exception really should be propogated.

Let me ask this: where you are uploading files, is Magnolia the consumer, or 
the Stripes ActionBean?  If it's the latter, then perhaps try putting the 
StripesFilter above the magnolia MultipartRequestFilter in the list.  If not, 
then I guess we need to find a tell-tale for when something has eaten the 
request stream and defend against it.

> multipart/form-data without file upload
> ---------------------------------------
>
>                 Key: STS-235
>                 URL: http://mc4j.org/jira/browse/STS-235
>             Project: Stripes
>          Issue Type: Bug
>    Affects Versions: Release 1.3.2
>            Reporter: Andreas Schulz
>         Assigned To: Tim Fennell
>
> If the StripesFilter receives a multipart/form-data request with no file 
> attached to it an IOException is thrown. But some applications like Magnolia 
> CMS use this enctype by default. So it crashes when using Stripes.
> Stacktrace:
> java.io.IOException: Corrupt form data: premature ending
>       at 
> com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:205)
>       at 
> com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:222)
>       at 
> com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:173)
>       at 
> net.sourceforge.stripes.controller.StripesRequestWrapper.<init>(StripesRequestWrapper.java:109)
>       at 
> net.sourceforge.stripes.controller.StripesFilter.wrapRequest(StripesFilter.java:239)
>       at 
> net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:209)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>       at 
> info.magnolia.cms.filters.MagnoliaManagedFilter$CustomFilterChain.doFilter(MagnoliaManagedFilter.java:80)
>       at 
> info.magnolia.cms.filters.UnsetContextFilter.doFilter(UnsetContextFilter.java:44)
>       at 
> info.magnolia.cms.filters.MagnoliaManagedFilter$CustomFilterChain.doFilter(MagnoliaManagedFilter.java:84)
>       at 
> info.magnolia.cms.security.SecurityFilter.doFilter(SecurityFilter.java:96)
>       at 
> info.magnolia.cms.filters.MagnoliaManagedFilter$CustomFilterChain.doFilter(MagnoliaManagedFilter.java:84)
>       at 
> info.magnolia.cms.filters.MultipartRequestFilter.doFilter(MultipartRequestFilter.java:80)
>       at 
> info.magnolia.cms.filters.MagnoliaManagedFilter$CustomFilterChain.doFilter(MagnoliaManagedFilter.java:84)
>       at 
> info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:66)
>       at 
> info.magnolia.cms.filters.MagnoliaManagedFilter$CustomFilterChain.doFilter(MagnoliaManagedFilter.java:84)
>       at 
> info.magnolia.cms.filters.MagnoliaManagedFilter.doFilter(MagnoliaManagedFilter.java:53)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>       at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>       at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>       at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>       at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>       at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>       at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>       at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>       at 
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>       at 
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>       at 
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>       at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>       at java.lang.Thread.run(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to