You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by shanghe chen <sh...@outlook.com> on 2024/10/23 02:50:48 UTC

IndexOutOfBoundsException at getHeader with tomcat9.0.87

Hi using tomcat 9.0.87, occasionally I got the following exception:

java.lang.IndexOutOfBoundsException
  at java.base/java.nio.ByteBuffer.wrap(ByteBuffer.java:438
  at org.apache.tomcat.util.buf.ByteChunk.toStringInternal(ByteChunk.java:622)
  at org.apache.tomcat.util.buf.StringCache.toString(StringCache.java:323)
  at org.apache.tomcat.util.buf.ByteChunk.toString(ByteChunk.java:580)
  at org.apache.tomcat.util.buf.ByteChunk.toString(ByteChunk.java:565)
  at org.apache.tomcat.util.buf.MessageBytes.toString(MessageBytes.java:173)
  at org.apache.tomcat.util.http.MimeHeaders.getHeader(MimeHeaders.java:355)
  at org.apache.coyote.Request.getHeader(Request.java:468)

when invoking the getHeader method. For lacking of the context, I cannot get the concrete header now and it seems quite hard to reproduce.

 I'm wondering if anyone has encountered the same issue before? is the MessageBytes malformed? I got a kind of related issue https://github.com/apache/tomcat/pull/551but not sure if it's relavent since it's involved in version 9.0.66.

Thanks for any help in advance!


Re: IndexOutOfBoundsException at getHeader with tomcat9.0.87

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Shanghe,

On 10/22/24 22:59, shanghe chen wrote:
> Sorry the link is https://github.com/apache/tomcat/pull/551<https://github.com/apache/tomcat/pull/551but> it seems malformed in last post
> ________________________________
> 发件人: shanghe chen <sh...@outlook.com>
> 发送时间: Wednesday, October 23, 2024 10:50:48 AM
> 收件人: users@tomcat.apache.org <us...@tomcat.apache.org>
> 主题: IndexOutOfBoundsException at getHeader with tomcat9.0.87
> 
> Hi using tomcat 9.0.87, occasionally I got the following exception:
> 
> java.lang.IndexOutOfBoundsException
>    at java.base/java.nio.ByteBuffer.wrap(ByteBuffer.java:438
>    at org.apache.tomcat.util.buf.ByteChunk.toStringInternal(ByteChunk.java:622)
>    at org.apache.tomcat.util.buf.StringCache.toString(StringCache.java:323)
>    at org.apache.tomcat.util.buf.ByteChunk.toString(ByteChunk.java:580)
>    at org.apache.tomcat.util.buf.ByteChunk.toString(ByteChunk.java:565)
>    at org.apache.tomcat.util.buf.MessageBytes.toString(MessageBytes.java:173)
>    at org.apache.tomcat.util.http.MimeHeaders.getHeader(MimeHeaders.java:355)
>    at org.apache.coyote.Request.getHeader(Request.java:468)
> 
> when invoking the getHeader method. For lacking of the context, I cannot get the concrete header now and it seems quite hard to reproduce.
> 
>   I'm wondering if anyone has encountered the same issue before? is the MessageBytes malformed? I got a kind of related issue https://github.com/apache/tomcat/pull/551but not sure if it's relavent since it's involved in version 9.0.66.

Can you post the complete stack trace?

If you must remove your own code from the stack trace, that's fine. But 
it would be good to see all of the Tomcat-related calls.

-chris


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


Re: IndexOutOfBoundsException at getHeader with tomcat9.0.87

Posted by shanghe chen <sh...@outlook.com>.
Sorry the link is https://github.com/apache/tomcat/pull/551<https://github.com/apache/tomcat/pull/551but> it seems malformed in last post
________________________________
发件人: shanghe chen <sh...@outlook.com>
发送时间: Wednesday, October 23, 2024 10:50:48 AM
收件人: users@tomcat.apache.org <us...@tomcat.apache.org>
主题: IndexOutOfBoundsException at getHeader with tomcat9.0.87

Hi using tomcat 9.0.87, occasionally I got the following exception:

java.lang.IndexOutOfBoundsException
  at java.base/java.nio.ByteBuffer.wrap(ByteBuffer.java:438
  at org.apache.tomcat.util.buf.ByteChunk.toStringInternal(ByteChunk.java:622)
  at org.apache.tomcat.util.buf.StringCache.toString(StringCache.java:323)
  at org.apache.tomcat.util.buf.ByteChunk.toString(ByteChunk.java:580)
  at org.apache.tomcat.util.buf.ByteChunk.toString(ByteChunk.java:565)
  at org.apache.tomcat.util.buf.MessageBytes.toString(MessageBytes.java:173)
  at org.apache.tomcat.util.http.MimeHeaders.getHeader(MimeHeaders.java:355)
  at org.apache.coyote.Request.getHeader(Request.java:468)

when invoking the getHeader method. For lacking of the context, I cannot get the concrete header now and it seems quite hard to reproduce.

 I'm wondering if anyone has encountered the same issue before? is the MessageBytes malformed? I got a kind of related issue https://github.com/apache/tomcat/pull/551but not sure if it's relavent since it's involved in version 9.0.66.

Thanks for any help in advance!