commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Smith" <dhtmlkitc...@gmail.com>
Subject "Stream ended unexpectedly" - simple testcase
Date Tue, 15 Jul 2008 16:39:28 GMT
Can't get my multipart/form-data processed. Error: "Stream ended
unexpectedly".

The post body is sent over XMLHttpRequest. (the submission works fine
if sent via "normal" form submission). There seems to be a problem
with the request. Bad headers, or content-length incorrect? I can't
spot the error.

Stacktrace:
	
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:
515)	
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
408)	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
320)	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	com.jspinsider.jspkit.gzip.GZIPFilter.doFilter(Unknown Source)
</pre></p><p><b>root cause</b> <pre>javax.servlet.ServletException:
org.apache.commons.fileupload.FileUploadException

: Processing of multipart/form-data request failed.
Stream ended unexpectedly
^^^^^^^^^^^^^^^^^^^^^^^^^^^

 page /ape/release/example/form/process.jsp at line 10
7: // Create a new file upload handler
8: ServletFileUpload upload = new ServletFileUpload(factory);
9:
10: List&lt;FileItem&gt; items = upload.parseRequest(request);
11: response.setContentType(&quot;text/plain&quot;);
12: out.write(items.toString());
13:


Here is the first request, via XMLHttpRequest form submission:
----------------------------------------------------------
http://localhost/ape/release/example/form/process.jsp

POST /ape/release/example/form/process.jsp HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:
1.9) Gecko/2008061004 Firefox/3.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: multipart/form-data; charset=UTF-8;
boundary=DATA1215979532633
Referer: http://localhost/ape/release/example/form/Form.html
Content-Length: 91
Cookie: JSESSIONID=242B477B4C9455A201CF1BF7D5CFCE16
Pragma: no-cache
Cache-Control: no-cache

--DATA1215979532633
Content-Disposition: form-data; name="name";

a
--DATA1215979532633--


HTTP/1.x 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 3840
Date: Sun, 13 Jul 2008 20:05:32 GMT
Connection: close

----------------------------------------------------------

Or is it problem with the ServletFileUpload parser?
?

Garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message