Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-1580

ArrayOutOfBoundsException in ActiveMQInputStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 5.0.0
    • 5.1.0
    • None
    • None
    • Ubuntu 7.10 / i686
      Sun Java 1.6.0_03

    Description

      When using JMS streaming, an ArrayOutOfBoundsException occurs in ActiveMQInputStream if the length of the streamed content is exactly a multiple of the chunk size sent by ActiveMQOutputStream (64KB at the moment).

      The last message received by fillBuffer in such a case has a bodyLength of 0, so
      buffer = new byte[0]; // line 225
      pos = 0; // line 227
      and in the next invocation of read()
      return buffer[pos]; // line 180
      fails with:
      java.lang.ArrayIndexOutOfBoundsException: 0
      at org.apache.activemq.ActiveMQInputStream.read(ActiveMQInputStream.java:180)
      at Crash.main(Crash.java:54)

      Attached is Crash.java which produces the exception.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--Crash.java
          2 kB
          Dieter Vrancken

        Activity

          People

            aco Adrian T. Co
            jackrabbit Dieter Vrancken
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: