Bug 7413 - java.io.CharConversionException om file upload, 4.0.4 Beta 2
Summary: java.io.CharConversionException om file upload, 4.0.4 Beta 2
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Connector:Coyote HTTP/1.1 (show other bugs)
Version: 4.0.4 Beta 1
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 7664 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-03-24 16:38 UTC by B
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description B 2002-03-24 16:38:52 UTC
When trying to upload a file when Coyote is used as http connector the following
exception occurs:

java.io.CharConversionException: isHexDigit
        at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:124)
        at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:87)
        at
org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:407)
        at
org.apache.coyote.tomcat4.CoyoteRequest.parseRequestParameters(CoyoteRequest.java:1893)
        at
org.apache.coyote.tomcat4.CoyoteRequest.getParameterNames(CoyoteRequest.java:914)
        at
org.apache.catalina.connector.RequestFacade.getParameterNames(RequestFacade.java:165)
        at webadm.servlet.Webadm.getRequestProperties(Webadm.java:296)
.
etc.... for every character in in the uploaded file. 
The last line shown is in my servlet: 
   Enumeration enum = request.getParameterNames ();
The servlet is extending VelocityServlet (1.2). File upload works ok when I use
the old http1.1 connector.
Comment 1 Remy Maucherat 2002-03-24 18:48:59 UTC
By uploading, I assume you mean you're doing a POST (which is not uploading to 
me; use PUT to upload).
I assume the body is a binary (not url form encoded), and you're using 
getParameterNames before doing anything else.

I looked at the code in the Toncat 4 adapter, and there's a bug (the check for 
the form content-type is missing). This probably is what causes the problem.
Sorry for the trouble; I rewrote the algorithm used in TC 4 to make it faster, 
but I forgot something (and since I'm testing only with the form content-type, 
I didn't notice anything) ;-)

I just put in a patch. If you could try it and confirm the bug is fixed, that 
would be nice.
Comment 2 Remy Maucherat 2002-04-01 18:51:11 UTC
*** Bug 7664 has been marked as a duplicate of this bug. ***