You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Daniel Dang <dd...@dolphtech.com> on 2007/06/08 17:07:35 UTC

Invalid Content-Length error for the size greater than

Hi All

I am using Apache-tomcat-5.5.16 version (ajp connector).
Every time when I send 2.1GB binary data the apache-tomcat-5.5.16 is
working fine. But when I tried to send 3GB binary data I got the
following error below: 

I am looking for a solution to send more than 3GB data to apache-tomcat

Many thanks in advance..

[TP-Processor3] ERROR common.HandlerRequest  - Error decoding request
java.lang.NumberFormatException
        at org.apache.tomcat.util.buf.Ascii.parseInt(Ascii.java:145)
        at
org.apache.tomcat.util.buf.ByteChunk.getInt(ByteChunk.java:521)
        at
org.apache.tomcat.util.buf.MessageBytes.getInt(MessageBytes.java:688)
        at
org.apache.jk.common.HandlerRequest.decodeHeaders(HandlerRequest.java:57
9)
        at
org.apache.jk.common.HandlerRequest.decodeRequest(HandlerRequest.java:39
7)
        at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:260)
        at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
        at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:
684)
        at org.apache.jk.common.ChannelSocket
$SocketConnection.runIt(ChannelSocket.
java:876)
        at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool
.java:684)
        at java.lang.Thread.run(Thread.java:619)


thanks
-- 
Daniel T. Dang



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


RE: Invalid Content-Length error for the size greater than

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Daniel Dang [mailto:ddang@dolphtech.com] 
> Subject: Invalid Content-Length error for the size greater than
> 
> But when I tried to send 3GB binary data I got the
> following error below: 

Since Bill B already answered your question the first time you sent it,
why did you send it again?

 - 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Invalid Content-Length error for the size greater than

Posted by Mark Thomas <ma...@apache.org>.
Christopher Schultz wrote:
> Mark Thomas wrote:
>> I'd use Connector:AJP but it doesn't really matter.
> 
> That appears to be a component of the "Tomcat" product... I'm curious
> why you make the distinction that this is /not/ a bug in Tomcat, but
> rather in mod_jk. If the bug goes under the "Tomcat" product, then ... ?

What I meant was it is fixed in the Coyote Connector, ie Tomcat
standalone.

Mark


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


Re: Invalid Content-Length error for the size greater than

Posted by Daniel Dang <dd...@dolphtech.com>.
Bill,

I believe I am using mod_proxy_ajp connector because this is what I have
on my httpd.conf:
ProxyPass /axis ajp://192.168.11.10:8009/axis
ProxyPassReverse /axis ajp://192.168.11.10:8009/axis
The version of mod_proxy_ajp is Apache/2.2.3

Thanks

On Tue, 2007-06-12 at 12:59 -0400, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Bill,
> 
> Bill Barker wrote:
> > This would let us 
> > see what mod_proxy_ajp is sending to Tomcat (which I very strongly suspect 
> > is wrong).
> 
> Tomcat should still accept any valid numeric Content-Length header, even
> if it exceeds Integer.MAX_VALUE. The Java AJP connector currently
> requires an int, but should accept something larger (albeit with reduced
> support through the HttpServletRequest.getContentLength method).
> 
> An end user should always be able to parse their own Content-Length
> header for large values. In this case, mod_whatever is breaking the
> number. However, once mod_whatever is fixed, the AJP connector will
> still trip over the fact that the value exceeds maxint.
> 
> (Looks like you have a fix for that. Which connectors does it cover?)
> 
> > However, if my guess is right, then the problem is with httpd sending a bad 
> > value for the Content-Length header, so you would have to report it over 
> > there and get it fixed.  I don't have enough spare cycles to test this 
> > myself, but I'm sure that between you and Chris it will get nailed down.
> 
> Two mod_jk heavy-lifters frequent the list (Mladen and Rainer). If it
> turns out that Daniel is using mod_jk, they should be notified
> separately. From Daniel's messages plus the info available in the bug,
> it's unclear whether he is using mod_jk or mod_proxy_ajp. That
> information is important to identify before bothering someone on either
> project ;)
> 
> This discussion can probably be taken off the mailing list and into
> Bugzilla: http://issues.apache.org/bugzilla/show_bug.cgi?id=42608
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFGbtD59CaO5/Lv0PARAhnOAJ4lyY65R4Ery20fPa0vDortYsO3vwCgroyq
> JSIy1JBN/u7zFBRS0nj4HKw=
> =+YL4
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
-- 
Daniel T. Dang
Software Engineer
Dolphin Technology, Inc.
474 Phoenix Drive 
Rome, NY 13441
email: ddang@dolphtech.com
phone: 315-838-1057
fax:   315-838-7096


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


Re: Invalid Content-Length error for the size greater than

Posted by Rainer Jung <ra...@kippdata.de>.
I committed a patch for mod_jk using 64 Bit unsigned ints for content 
length. This patch still needs testing. I only verified, that it does 
not break normal operation (at least not on Solaris with Apache 2.2).

I don't know, if anyone of those who were working on this bug until now 
(Bill? Mark? Chris? Daniel) already have a good test setup including 
Bills patch for the JK connector. It would be nice, if you could report 
your findings. I included a download URL in BZ 42608, where you can find 
a ready to build mod_jk tarball.

I tried to adjust all places, including Apache 1.3, 2.x, IIS and 
Netscape, also the byte counters in the load balancer and AJP12/AJP13.

For the web servers I actually don't know, if we can really get huge 
byte counts back, e.g. if there is a huge upload, or if they already 
have a 32Bit problem decoding the sizes.

We would need to test separately for *nix and Win, because the jk 64Bit 
unsigned uses different types and formatting characters for those platforms.

Regards,

Rainer

Bill Barker wrote:
> Of course both Mladen and Rainer are on dev@tomcat, so they have seen the 
> traffic on the bug report (as are a couple of the other mod_proxy_ajp 
> developers).

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


Re: Invalid Content-Length error for the size greater than

Posted by Bill Barker <wb...@wilshire.com>.
"Christopher Schultz" <ch...@christopherschultz.net> wrote in message 
news:466ED0F9.3070909@christopherschultz.net...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Bill,
>
> Bill Barker wrote:
>> This would let us
>> see what mod_proxy_ajp is sending to Tomcat (which I very strongly 
>> suspect
>> is wrong).
>
> Tomcat should still accept any valid numeric Content-Length header, even
> if it exceeds Integer.MAX_VALUE. The Java AJP connector currently
> requires an int, but should accept something larger (albeit with reduced
> support through the HttpServletRequest.getContentLength method).
>
> An end user should always be able to parse their own Content-Length
> header for large values. In this case, mod_whatever is breaking the
> number. However, once mod_whatever is fixed, the AJP connector will
> still trip over the fact that the value exceeds maxint.
>
> (Looks like you have a fix for that. Which connectors does it cover?)
>

All of the non-deprecated ones now from TC 3.3-6.x (at least in SVN), 
including the upcoming TC 5.5.24: 
http://mail-archives.apache.org/mod_mbox/tomcat-dev/200706.mbox/%3c46706E62.2050507@hanik.com%3e. 
But they mostly worked (or at least didn't do more than drop the connection) 
before this.


>> However, if my guess is right, then the problem is with httpd sending a 
>> bad
>> value for the Content-Length header, so you would have to report it over
>> there and get it fixed.  I don't have enough spare cycles to test this
>> myself, but I'm sure that between you and Chris it will get nailed down.
>
> Two mod_jk heavy-lifters frequent the list (Mladen and Rainer). If it
> turns out that Daniel is using mod_jk, they should be notified
> separately. From Daniel's messages plus the info available in the bug,
> it's unclear whether he is using mod_jk or mod_proxy_ajp. That
> information is important to identify before bothering someone on either
> project ;)
>

Of course both Mladen and Rainer are on dev@tomcat, so they have seen the 
traffic on the bug report (as are a couple of the other mod_proxy_ajp 
developers).

> This discussion can probably be taken off the mailing list and into
> Bugzilla: http://issues.apache.org/bugzilla/show_bug.cgi?id=42608
>

Unless you are also on dev@tomcat, you haven't CCed yourself on this one.

> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGbtD59CaO5/Lv0PARAhnOAJ4lyY65R4Ery20fPa0vDortYsO3vwCgroyq
> JSIy1JBN/u7zFBRS0nj4HKw=
> =+YL4
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 




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


Re: Invalid Content-Length error for the size greater than

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bill,

Bill Barker wrote:
> This would let us 
> see what mod_proxy_ajp is sending to Tomcat (which I very strongly suspect 
> is wrong).

Tomcat should still accept any valid numeric Content-Length header, even
if it exceeds Integer.MAX_VALUE. The Java AJP connector currently
requires an int, but should accept something larger (albeit with reduced
support through the HttpServletRequest.getContentLength method).

An end user should always be able to parse their own Content-Length
header for large values. In this case, mod_whatever is breaking the
number. However, once mod_whatever is fixed, the AJP connector will
still trip over the fact that the value exceeds maxint.

(Looks like you have a fix for that. Which connectors does it cover?)

> However, if my guess is right, then the problem is with httpd sending a bad 
> value for the Content-Length header, so you would have to report it over 
> there and get it fixed.  I don't have enough spare cycles to test this 
> myself, but I'm sure that between you and Chris it will get nailed down.

Two mod_jk heavy-lifters frequent the list (Mladen and Rainer). If it
turns out that Daniel is using mod_jk, they should be notified
separately. From Daniel's messages plus the info available in the bug,
it's unclear whether he is using mod_jk or mod_proxy_ajp. That
information is important to identify before bothering someone on either
project ;)

This discussion can probably be taken off the mailing list and into
Bugzilla: http://issues.apache.org/bugzilla/show_bug.cgi?id=42608

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGbtD59CaO5/Lv0PARAhnOAJ4lyY65R4Ery20fPa0vDortYsO3vwCgroyq
JSIy1JBN/u7zFBRS0nj4HKw=
=+YL4
-----END PGP SIGNATURE-----

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


Re: Invalid Content-Length error for the size greater than

Posted by Bill Barker <wb...@wilshire.com>.
"Daniel Dang" <dd...@dolphtech.com> wrote in message 
news:1181576088.4540.37.camel@dang2.dolphtech.com...
> Bill,
>
> As your comment earlier I did open a bug here is a link:
> http://issues.apache.org/bugzilla/show_bug.cgi?id=42608
> I don't know It's a right place to open this DR and those developers
> have time to do anything with it.
>
> apache-tomcat is a new baby to me and I am not familiar with mod_jk
> source. I am using apache-tomcat-5.5.16 and mod_proxy, mod_proxy_ajp
> with server version Apache/2.2.3
>

After a brief look at mod_proxy_ajp, it looks like Tomcat should work with 
it (but mod_jk has issues).  It would still be helpful if you could 
configure DEBUG logging for the category org.apache.jk (as in 
http://tomcat.apache.org/tomcat-5.5-doc/logging.html).  This would let us 
see what mod_proxy_ajp is sending to Tomcat (which I very strongly suspect 
is wrong).  You could also try asking on users@httpd.apache.org to see if 
anyone there knows.

> I have look at the latest version apache-tomcat-6 the
> HandlerRequest.java in the decodeHeader method it looks very much the
> same to apache-tomcat-5.5.16 version they still calling
> MessageBytes.getInt(*) instead of getLong(). The getLong() method is
> there and available in MessageBytes class.
>

I checked in a fix yesterday to the 5.5 branch to fix that.  I'll port it to 
the 6.0 branch when I get a chance (there hasn't been an annouced release, 
so there is still time).  You could get the latest from SVN and test that 
(you'll need to upgrade anyway to get Mark's fix).  Also, 5.5.24 should be 
coming out soon, so you could just wait for that.

However, if my guess is right, then the problem is with httpd sending a bad 
value for the Content-Length header, so you would have to report it over 
there and get it fixed.  I don't have enough spare cycles to test this 
myself, but I'm sure that between you and Chris it will get nailed down.

> If we modified anything with mod_jk*, I don't really know it will fix
> the problem without modifying the tomcat? But whatever ways is work so
> that I can able to send more then 3GB is the goal and I would like to
> thanks to developers people like you guys.
>
> Cheers
>
> --Daniel Dang
>
>
>
> On Sun, 2007-06-10 at 13:16 -0700, Bill Barker wrote:
>> "Christopher Schultz" <ch...@christopherschultz.net> wrote in message
>> news:466C097A.4010402@christopherschultz.net...
>> > -----BEGIN PGP SIGNED MESSAGE-----
>> > Hash: SHA1
>> >
>> > Mark,
>> >
>> > Mark Thomas wrote:
>> >> Christopher Schultz wrote:
>> >>> Since the Java part of the connector is bundled with Tomcat, is that
>> >>> considered to be "part" of mod_jk (which I always thought of as the
>> >>> c/c++ apache httpd module) or "part" of Tomcat? For instance, if I 
>> >>> were
>> >>> to log a bug... where would it go? I don't see a proper product in
>> >>> bugzilla (Connectors, Tomcat Connectors, mod_jk, Apache mod_jk, ... 
>> >>> none
>> >>> of those exist).
>> >>
>> >> I'd use Connector:AJP but it doesn't really matter.
>> >
>> > That appears to be a component of the "Tomcat" product... I'm curious
>> > why you make the distinction that this is /not/ a bug in Tomcat, but
>> > rather in mod_jk. If the bug goes under the "Tomcat" product, then ... 
>> > ?
>> >
>>
>> There isn't a lot of overlap at the moment between developers that work 
>> on
>> mod_jk and those that work on the Java side.
>>
>> >>> I'd even be happy to provide a patch; I already made the mods in a 
>> >>> fresh
>> >>> source copy and they compile... no testing, yet.
>> >>
>> >> Great. When you are happy with your patch, open a bugzilla entry and
>> >> attach the patch.
>> >
>> > Okay, I'll get together with Bill and work on something.
>> >
>>
>> mod_jk stores the content-length internally as an int.  I think that 
>> older
>> versions of mod_jk sent the internal version (sprintf or similar), and 
>> since
>> the OP is using a very old version of Tomcat, he might be using an old
>> mod_jk as well.  With the latest versions of both, it looks like the
>> header-parsing on the Java side will work (since the original header 
>> value
>> is sent), but you won't actually get the request body because mod_jk 
>> thinks
>> the content-length is negative.
>>
>> I haven't actually tested it, this is just from looking at the code.  The
>> mod_jk files to start with are apache-x.x/mod_jk.c and
>> common/jk_ajp_common.c.  HandlerRequest.java should probably be using 
>> longs
>> as well, but it looks like it would recover eventually.
>> > Thanks,
>> > - -chris
>> > -----BEGIN PGP SIGNATURE-----
>> > Version: GnuPG v1.4.7 (MingW32)
>> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>> >
>> > iD8DBQFGbAl69CaO5/Lv0PARAuftAJ0euvzf+fCpMrA1x2PQ4dUQlFT6RQCgtQfO
>> > dljS164b+JMDO+UYvdZjrpw=
>> > =o8BI
>> > -----END PGP SIGNATURE-----
>> >
>> > ---------------------------------------------------------------------
>> > To start a new topic, e-mail: users@tomcat.apache.org
>> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>> >
>> >
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
> -- 
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 




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


Re: Invalid Content-Length error for the size greater than

Posted by Daniel Dang <dd...@dolphtech.com>.
Bill,

As your comment earlier I did open a bug here is a link:
http://issues.apache.org/bugzilla/show_bug.cgi?id=42608
I don't know It's a right place to open this DR and those developers 
have time to do anything with it.

apache-tomcat is a new baby to me and I am not familiar with mod_jk
source. I am using apache-tomcat-5.5.16 and mod_proxy, mod_proxy_ajp
with server version Apache/2.2.3

I have look at the latest version apache-tomcat-6 the
HandlerRequest.java in the decodeHeader method it looks very much the
same to apache-tomcat-5.5.16 version they still calling
MessageBytes.getInt(*) instead of getLong(). The getLong() method is
there and available in MessageBytes class.

If we modified anything with mod_jk*, I don't really know it will fix
the problem without modifying the tomcat? But whatever ways is work so
that I can able to send more then 3GB is the goal and I would like to
thanks to developers people like you guys.

Cheers

--Daniel Dang 



On Sun, 2007-06-10 at 13:16 -0700, Bill Barker wrote:
> "Christopher Schultz" <ch...@christopherschultz.net> wrote in message 
> news:466C097A.4010402@christopherschultz.net...
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Mark,
> >
> > Mark Thomas wrote:
> >> Christopher Schultz wrote:
> >>> Since the Java part of the connector is bundled with Tomcat, is that
> >>> considered to be "part" of mod_jk (which I always thought of as the
> >>> c/c++ apache httpd module) or "part" of Tomcat? For instance, if I were
> >>> to log a bug... where would it go? I don't see a proper product in
> >>> bugzilla (Connectors, Tomcat Connectors, mod_jk, Apache mod_jk, ... none
> >>> of those exist).
> >>
> >> I'd use Connector:AJP but it doesn't really matter.
> >
> > That appears to be a component of the "Tomcat" product... I'm curious
> > why you make the distinction that this is /not/ a bug in Tomcat, but
> > rather in mod_jk. If the bug goes under the "Tomcat" product, then ... ?
> >
> 
> There isn't a lot of overlap at the moment between developers that work on 
> mod_jk and those that work on the Java side.
> 
> >>> I'd even be happy to provide a patch; I already made the mods in a fresh
> >>> source copy and they compile... no testing, yet.
> >>
> >> Great. When you are happy with your patch, open a bugzilla entry and
> >> attach the patch.
> >
> > Okay, I'll get together with Bill and work on something.
> >
> 
> mod_jk stores the content-length internally as an int.  I think that older 
> versions of mod_jk sent the internal version (sprintf or similar), and since 
> the OP is using a very old version of Tomcat, he might be using an old 
> mod_jk as well.  With the latest versions of both, it looks like the 
> header-parsing on the Java side will work (since the original header value 
> is sent), but you won't actually get the request body because mod_jk thinks 
> the content-length is negative.
> 
> I haven't actually tested it, this is just from looking at the code.  The 
> mod_jk files to start with are apache-x.x/mod_jk.c and 
> common/jk_ajp_common.c.  HandlerRequest.java should probably be using longs 
> as well, but it looks like it would recover eventually.
> > Thanks,
> > - -chris
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.7 (MingW32)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> >
> > iD8DBQFGbAl69CaO5/Lv0PARAuftAJ0euvzf+fCpMrA1x2PQ4dUQlFT6RQCgtQfO
> > dljS164b+JMDO+UYvdZjrpw=
> > =o8BI
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> > 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
-- 


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


Re: Invalid Content-Length error for the size greater than

Posted by Bill Barker <wb...@wilshire.com>.
"Christopher Schultz" <ch...@christopherschultz.net> wrote in message 
news:466C097A.4010402@christopherschultz.net...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Mark,
>
> Mark Thomas wrote:
>> Christopher Schultz wrote:
>>> Since the Java part of the connector is bundled with Tomcat, is that
>>> considered to be "part" of mod_jk (which I always thought of as the
>>> c/c++ apache httpd module) or "part" of Tomcat? For instance, if I were
>>> to log a bug... where would it go? I don't see a proper product in
>>> bugzilla (Connectors, Tomcat Connectors, mod_jk, Apache mod_jk, ... none
>>> of those exist).
>>
>> I'd use Connector:AJP but it doesn't really matter.
>
> That appears to be a component of the "Tomcat" product... I'm curious
> why you make the distinction that this is /not/ a bug in Tomcat, but
> rather in mod_jk. If the bug goes under the "Tomcat" product, then ... ?
>

There isn't a lot of overlap at the moment between developers that work on 
mod_jk and those that work on the Java side.

>>> I'd even be happy to provide a patch; I already made the mods in a fresh
>>> source copy and they compile... no testing, yet.
>>
>> Great. When you are happy with your patch, open a bugzilla entry and
>> attach the patch.
>
> Okay, I'll get together with Bill and work on something.
>

mod_jk stores the content-length internally as an int.  I think that older 
versions of mod_jk sent the internal version (sprintf or similar), and since 
the OP is using a very old version of Tomcat, he might be using an old 
mod_jk as well.  With the latest versions of both, it looks like the 
header-parsing on the Java side will work (since the original header value 
is sent), but you won't actually get the request body because mod_jk thinks 
the content-length is negative.

I haven't actually tested it, this is just from looking at the code.  The 
mod_jk files to start with are apache-x.x/mod_jk.c and 
common/jk_ajp_common.c.  HandlerRequest.java should probably be using longs 
as well, but it looks like it would recover eventually.
> Thanks,
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGbAl69CaO5/Lv0PARAuftAJ0euvzf+fCpMrA1x2PQ4dUQlFT6RQCgtQfO
> dljS164b+JMDO+UYvdZjrpw=
> =o8BI
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 




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


Re: Invalid Content-Length error for the size greater than

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark,

Mark Thomas wrote:
> Christopher Schultz wrote:
>> Since the Java part of the connector is bundled with Tomcat, is that
>> considered to be "part" of mod_jk (which I always thought of as the
>> c/c++ apache httpd module) or "part" of Tomcat? For instance, if I were
>> to log a bug... where would it go? I don't see a proper product in
>> bugzilla (Connectors, Tomcat Connectors, mod_jk, Apache mod_jk, ... none
>> of those exist).
>
> I'd use Connector:AJP but it doesn't really matter.

That appears to be a component of the "Tomcat" product... I'm curious
why you make the distinction that this is /not/ a bug in Tomcat, but
rather in mod_jk. If the bug goes under the "Tomcat" product, then ... ?

>> I'd even be happy to provide a patch; I already made the mods in a fresh
>> source copy and they compile... no testing, yet.
>
> Great. When you are happy with your patch, open a bugzilla entry and
> attach the patch.

Okay, I'll get together with Bill and work on something.

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGbAl69CaO5/Lv0PARAuftAJ0euvzf+fCpMrA1x2PQ4dUQlFT6RQCgtQfO
dljS164b+JMDO+UYvdZjrpw=
=o8BI
-----END PGP SIGNATURE-----

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


Re: Invalid Content-Length error for the size greater than

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bill,

Bill Barker wrote:
> Yes, the exception is thrown because the first character in the 
> Content-Length header isn't a digit, so I'm guessing that it is coming in 
> with a leading '-' from mod_jk.  Otherwise, while the Java side could be 
> improved, the JK Connector would handle this correctly.

Hmm... a negative Content-Length header? That doesn't seem right.
Daniel, can you post the headers somehow? (Maybe using LiveHTTPHeaders
with Mozilla Firefox to capture them). mod_jk should not be modifying
the Content-Length header, so I would imagine that the length isn't
negative. Maybe it does. I have no familiarity with the mod_jk source.

The code for the "Ascii" utility class looks like it would only blow up
in the way Daniel observed if the header contained non-digit characters,
though.

Strange...

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFGbA1J9CaO5/Lv0PARAgvXAJYrhWqTIkwQy7zMiNZrPbFloCxsAJ9SSu5N
Ij8d71Nizcm2vQ2QGzKsIA==
=8+JT
-----END PGP SIGNATURE-----

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


Re: Invalid Content-Length error for the size greater than

Posted by Bill Barker <wb...@wilshire.com>.
"Mark Thomas" <ma...@apache.org> wrote in message 
news:466AC12D.4080805@apache.org...
> Christopher Schultz wrote:
>> Mark Thomas wrote:
>>> It's fixed in Tomcat. See Bill's reply to your original post on this
>>> topic for possible mod_jk / AJP issues.
>>
>> Oh, sorry. I see that it's a bug in the Java half of the Jk connector.
> I haven't looked at the code, but from Bill's post it looks like he
> has and there are possible issues with mod_jk and and Tomcat AJP
> connectors.
>

Yes, the exception is thrown because the first character in the 
Content-Length header isn't a digit, so I'm guessing that it is coming in 
with a leading '-' from mod_jk.  Otherwise, while the Java side could be 
improved, the JK Connector would handle this correctly.

>> Since the Java part of the connector is bundled with Tomcat, is that
>> considered to be "part" of mod_jk (which I always thought of as the
>> c/c++ apache httpd module) or "part" of Tomcat? For instance, if I were
>> to log a bug... where would it go? I don't see a proper product in
>> bugzilla (Connectors, Tomcat Connectors, mod_jk, Apache mod_jk, ... none
>> of those exist).
> I'd use Connector:AJP but it doesn't really matter.
>
>> I'd even be happy to provide a patch; I already made the mods in a fresh
>> source copy and they compile... no testing, yet.
> Great. When you are happy with your patch, open a bugzilla entry and
> attach the patch.
>
> Mark
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 




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


Re: Invalid Content-Length error for the size greater than

Posted by Mark Thomas <ma...@apache.org>.
Christopher Schultz wrote:
> Mark Thomas wrote:
>> It's fixed in Tomcat. See Bill's reply to your original post on this
>> topic for possible mod_jk / AJP issues.
> 
> Oh, sorry. I see that it's a bug in the Java half of the Jk connector.
I haven't looked at the code, but from Bill's post it looks like he
has and there are possible issues with mod_jk and and Tomcat AJP
connectors.

> Since the Java part of the connector is bundled with Tomcat, is that
> considered to be "part" of mod_jk (which I always thought of as the
> c/c++ apache httpd module) or "part" of Tomcat? For instance, if I were
> to log a bug... where would it go? I don't see a proper product in
> bugzilla (Connectors, Tomcat Connectors, mod_jk, Apache mod_jk, ... none
> of those exist).
I'd use Connector:AJP but it doesn't really matter.

> I'd even be happy to provide a patch; I already made the mods in a fresh
> source copy and they compile... no testing, yet.
Great. When you are happy with your patch, open a bugzilla entry and
attach the patch.

Mark


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


Re: Invalid Content-Length error for the size greater than

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark,

Mark Thomas wrote:
> Christopher Schultz wrote:
>> Filip,
>>
>> Filip Hanik - Dev Lists wrote:
>>> the servlet specification defines Content-Length as an int. even
>>> though in some places tomcat has it as a long, you are still running
>>> into this limitation so the problem is in the spec, and needs to be
>>> corrected there
>> I've seen this before in other containers, and honestly, I consider it a
>> bug.
> 
> It's fixed in Tomcat. See Bill's reply to your original post on this
> topic for possible mod_jk / AJP issues.

Oh, sorry. I see that it's a bug in the Java half of the Jk connector.

Since the Java part of the connector is bundled with Tomcat, is that
considered to be "part" of mod_jk (which I always thought of as the
c/c++ apache httpd module) or "part" of Tomcat? For instance, if I were
to log a bug... where would it go? I don't see a proper product in
bugzilla (Connectors, Tomcat Connectors, mod_jk, Apache mod_jk, ... none
of those exist).

I'd even be happy to provide a patch; I already made the mods in a fresh
source copy and they compile... no testing, yet.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGarkM9CaO5/Lv0PARAlEPAJ9d82hPF95qz3pcvTqvQhTg2mcwmACfZEM2
J0fmFINyti8bj8maVhlqPVo=
=51CX
-----END PGP SIGNATURE-----

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


Re: Invalid Content-Length error for the size greater than

Posted by Mark Thomas <ma...@apache.org>.
Christopher Schultz wrote:
> Filip,
> 
> Filip Hanik - Dev Lists wrote:
>> the servlet specification defines Content-Length as an int. even
>> though in some places tomcat has it as a long, you are still running
>> into this limitation so the problem is in the spec, and needs to be
>> corrected there
> 
> I've seen this before in other containers, and honestly, I consider it a
> bug.

It's fixed in Tomcat. See Bill's reply to your original post on this
topic for possible mod_jk / AJP issues.

Mark


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


Re: Invalid Content-Length error for the size greater than

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Filip,

Filip Hanik - Dev Lists wrote:
> the servlet specification defines Content-Length as an int. even
> though in some places tomcat has it as a long, you are still running
> into this limitation so the problem is in the spec, and needs to be
> corrected there

I've seen this before in other containers, and honestly, I consider it a
bug.

Yes, the servlet specification defines Content-Length as an int.
However, you can see in the stack trace that Tomcat isn't using the
servlet API to fetch the Content-Length from the HTTP headers.

Instead, Tomcat could parse the header as a long integer and issue a
warning if the value is larger than Integer.MAX_VALUE.

This would still allow servlet code to fetch the Content-Length of a
request using request.getHeaderString("Content-Length") and parsing it
as a long integer.

Just my two cents.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGaqcE9CaO5/Lv0PARAk7TAJwJ+ZuGzoc1TnfhQT9deTEYF8G19QCePsix
cgM2luMToGtjfW8rygm16fI=
=hNAm
-----END PGP SIGNATURE-----

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


Re: Invalid Content-Length error for the size greater than

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
the servlet specification defines Content-Length as an int. even though 
in some places tomcat has it as a long, you are still running into this 
limitation
so the problem is in the spec, and needs to be corrected there
Filip

Daniel Dang wrote:
> Hi All
>
> I am using Apache-tomcat-5.5.16 version (ajp connector).
> Every time when I send 2.1GB binary data the apache-tomcat-5.5.16 is
> working fine. But when I tried to send 3GB binary data I got the
> following error below: 
>
> I am looking for a solution to send more than 3GB data to apache-tomcat
>
> Many thanks in advance..
>
> [TP-Processor3] ERROR common.HandlerRequest  - Error decoding request
> java.lang.NumberFormatException
>         at org.apache.tomcat.util.buf.Ascii.parseInt(Ascii.java:145)
>         at
> org.apache.tomcat.util.buf.ByteChunk.getInt(ByteChunk.java:521)
>         at
> org.apache.tomcat.util.buf.MessageBytes.getInt(MessageBytes.java:688)
>         at
> org.apache.jk.common.HandlerRequest.decodeHeaders(HandlerRequest.java:57
> 9)
>         at
> org.apache.jk.common.HandlerRequest.decodeRequest(HandlerRequest.java:39
> 7)
>         at
> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:260)
>         at
> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
>         at
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:
> 684)
>         at org.apache.jk.common.ChannelSocket
> $SocketConnection.runIt(ChannelSocket.
> java:876)
>         at org.apache.tomcat.util.threads.ThreadPool
> $ControlRunnable.run(ThreadPool
> .java:684)
>         at java.lang.Thread.run(Thread.java:619)
>
>
> thanks
>   


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