Bug 56336 - IndexOutOfBoundsException in the AjpNio2Processor.output() method
Summary: IndexOutOfBoundsException in the AjpNio2Processor.output() method
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Connectors (show other bugs)
Version: 8.0.x-trunk
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 19:32 UTC by bdevaney
Modified: 2014-04-03 12:37 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bdevaney 2014-04-01 19:32:35 UTC
Generated with the NIO2 protocol in the connector.  The same code using tomcat with HTTP/1.1 and AJP/1.3 in the connector worked correctly.  

java.lang.IndexOutOfBoundsException
	at java.nio.Buffer.checkBounds(Buffer.java:559)
	at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:181)
	at org.apache.coyote.ajp.AjpNio2Processor.output(AjpNio2Processor.java:158)
	at org.apache.coyote.ajp.AbstractAjpProcessor.writeResponseMessage(AbstractAjpProcessor.java:1658)
	at org.apache.coyote.ajp.AbstractAjpProcessor.writeData(AbstractAjpProcessor.java:1577)
	at org.apache.coyote.ajp.AbstractAjpProcessor.access$200(AbstractAjpProcessor.java:62)
	at org.apache.coyote.ajp.AbstractAjpProcessor$SocketOutputBuffer.doWrite(AbstractAjpProcessor.java:1725)
	at org.apache.coyote.Response.doWrite(Response.java:523)
	at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:391)
	at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:344)
	at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:421)
	at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:409)
	at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:97)
	at java.io.DataOutputStream.write(DataOutputStream.java:107)
	at java.io.FilterOutputStream.write(FilterOutputStream.java:97)
Comment 1 Remy Maucherat 2014-04-01 22:43:05 UTC
The AJP connector is really heavy on code reuse, so the NIO2 code that is used here is identical to the NIO1 code (and the shared code looks like it's only working by accident, so I'll try to fix it http://svn.apache.org/r1583814 ).

You could investigate and debug to see why this exception occurs or test the fix.
Comment 2 Remy Maucherat 2014-04-03 12:37:23 UTC
No feedback, so assume fixed by r1583814