Caldarale, Charles R wrote:
From: Patrick Mc Erlean [mailto:[EMAIL PROTECTED] Subject: Re: How do I update the commons-fileupdate JAR from 1.0 to 1.2?

I understand what you're saying and it does seem strange that the commons-fileupload jar lives under the manager webapp.

Not strange at all - the manager webapp uses it to deploy apps from the
client workstation onto the server.

However, my understanding is that this jar is part of the Apache Tomcat base installation and that it plays a part
in the processing of all HTTP requests.

Nope - this particular instance only comes into play when deploying apps
with Tomcat's manager app.  If you have another app that's making use of
the commons-fileupload*.jar, it must have its own copy.  That's why I
keep asking you what URL or webapp the mobile device is accessing - but
you still haven't answered that question.

Do you see what I am saying? This commons-fileupload jar is part of Apache Tomcat and is used to parse every HTTP request.

It is only part of Tomcat's manager app; it is not global to all of
Tomcat.

I just need to know how to update it properly.

I suspect the real problem is your webapp is not using
commons-fileupload at all, and is merely trying to read in data directly
from the stream.  If you would simply answer the question about which
webapp the mobile device is accessing, perhaps we could get somewhere.
[Patrick]

The URL of my servlet is http://www.noveleditions.com/gaaradio/servlet/GAARadioServlet. My servlet does read from the input stream of the http servet request, and doesn't use FileUploadBase directly. The servlet lives in a webapp directory called gaaradio. The servlet mapping is set up and works fine when the HTTP POST data is less than 2016 bytes. However in the case where I get the 411 code my servlet is never invoked. I know this because I have the RequestDumperValve turned on in Tomcat and no logs are output in that case. That leads me to believe that something checks the request before it hits my servlet and since it is rejected my servlet is not invoked.

My client side code creates a HttpConnection (MIDP2.0) and then opens an output stream to write the POST data. The servlet opens an input stream to read that data. If the client writes POST data of less than 2016 bytes everything works fine. If the client writes POST data > 2016 bytes then the MIDP stack sends that data as Chunked Transfer (I have no control over that). That's when I get a response code of 411 from the Apache Tomcat server. In this later case the servlet does not get invoked at all. It appears that it is the actual servlet container that rejects the request on the basis that it expects the Content-Length to be something other than -1 (which is not HTTP 1.1. compliant). Apparently the reason Apache rejects this request is that there is a Content Length check for -1 in the FileUploadBase class. I don't know how or what invokes that class but that looks to be what is causing this bug. That class is fixed in the commons-fileupload-1.2.jar. Again, how Apache invokes this , I don't know but it looks like it's invoked before the request hits my servlet. As I say, the request never hits my servlet in situations where I get the 411 response code (i.e. HTTP POST data over 2016 bytes).

Here are a couple of references for further information:

http://developer.sonyericsson.com/thread.jspa?messageID=87668
http://issues.apache.org/jira/browse/FILEUPLOAD-93

I'm fairly inexperienced in all of this stuff so forgive me if I'm being niave.

It's pretty clear to me that there is a problem with Chunked Transfer somewhere in Apache since it doesn't work. Chunked Transfer sets the Content Length to -1 and Apache doesn't like that.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to