Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006077 [Resin] minor always 07-27-17 14:04 11-21-17 09:43
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0006077: multipart/form-data caucho.multipart.form.error
Description (rep by Steffen Busch)
Please fill "caucho.multipart.form.error" and "caucho.multipart.form.error.size" in case of IllegalStateException as well.

I'm trying to use the Servlet 3.0+ Capabilities of the multipart/form-data requests and looked up several Caucho resources such as:
 1: [^]
 2: [^]

I would really like to use the two offered Request attributes as mentioned on the 2: Link to improve error messages to users.

If the upload is larger than the limit or if multipart-form processing is disabled, Resin will not parse the request and will set an error message in the "caucho.multipart.form.error" request attribute. The "caucho.multipart.form.error.size" will contain the attempted upload size.

However, the "caucho.multipart.form.error" and "caucho.multipart.form.error.size" request attributes are empty in the following two situations:

Sitation 1: IllegalStateException (caused by

For example if a single File (Part) is processed and the Size is greater than <max-file-size>10M</max-file-size> from the Servlet's <multipart-config>

java.lang.IllegalStateException: multipart form data part 'File':'11148012' is greater then the accepted value of '10485760'
  at com.caucho.server.http.MultipartFormParser.parsePostData(
  at com.caucho.server.http.AbstractCauchoRequest.parsePostQueryImpl(
  at com.caucho.server.http.AbstractCauchoRequest.parseQueryImpl(
  at com.caucho.server.http.AbstractCauchoRequest.getParts(

Sitation 2: IllegalStateException (caused by

For example if several files (Parts) are processed (none of them is bigger than <max-file-size> see Situation 1) but the total size is greater than <max-request-size>10M</max-request-size> from the Servlet's <multipart-config>

java.lang.IllegalStateException: multipart form data request's Content-Length '20780351' is greater then configured in @MultipartConfig.maxRequestSize value: '10485760'
  at com.caucho.server.http.AbstractCauchoRequest.parsePostQueryImpl(
  at com.caucho.server.http.AbstractCauchoRequest.parseQueryImpl(
  at com.caucho.server.http.AbstractCauchoRequest.getParts(

Stacktraces obtained from Caucho Resin 4.0.50

It would be great if you can fill "caucho.multipart.form.error" and "caucho.multipart.form.error.size" request attributes in both cases.

Whenever I experienced an IOException from MultipartFormParser caused by "throw formError" at least the "caucho.multipart.form.error" attribute was present and most of the time the "caucho.multipart.form.error.size" too.
For example:
 * multipart form data '{0}' too large
 * multipart form upload failed (possibly due to full disk)
 * multipart form upload failed because field '{0}' exceeds max length {1}
 * End of post before multipart-mime boundary

Additional Information
Attached Files

- Relationships

- Notes
08-02-17 14:25


- Issue History
Date Modified Username Field Change
07-27-17 14:04 ferg New Issue
07-27-17 14:07 stbu Issue Monitored: stbu
08-02-17 14:25 ferg Note Added: 0006774
08-02-17 14:25 ferg Assigned To  => ferg
08-02-17 14:25 ferg Status new => assigned
08-02-17 14:25 ferg Resolution open => fixed
08-02-17 14:25 ferg Fixed in Version  => 4.0.55
08-03-17 14:43 ferg Status assigned => closed
11-21-17 09:43 ferg Fixed in Version 4.0.55 => 4.0.54

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker