Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-16627

java.lang.IndexOutOfBoundsException when calling ClientMessage.saveToOutputStream()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 7.2.0.GA
    • ActiveMQ
    • None
    • Hide

      No

      Show
      No
    • Hide
      • Download test_case.zip
      • make sure you have a broker with a queue called exampleQueue, and an acceptor on localhost 5445
      • Run the test client: mvn clean compile exec:java
      • In the pom.xml is modified to use "2.3.25.SP28-redhat-1" instead of "2.4.7.Final-redhat-1", same code works
      Show
      Download test_case.zip make sure you have a broker with a queue called exampleQueue, and an acceptor on localhost 5445 Run the test client: mvn clean compile exec:java In the pom.xml is modified to use "2.3.25.SP28-redhat-1" instead of "2.4.7.Final-redhat-1", same code works

    Description

      Calling the following hornetq 2.4 in EAP7.2 to save a byte message to a stream:

          ClientMessage messageReceived = null;
          messageReceived = messageConsumer.receive();
          ByteArrayOutputStream bao = new ByteArrayOutputStream();
          messageReceived.saveToOutputStream(bao);
      

      causes the following error:

      java.lang.IndexOutOfBoundsException: readerIndex(40091) + length(40000) exceeds writerIndex(40091): UnpooledHeapByteBuf(ridx: 40091, widx: 40091, cap: 65536)
      	at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1165)
      	at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:675)
      	at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:683)
      	at io.netty.buffer.WrappedByteBuf.readBytes(WrappedByteBuf.java:511)
      	at org.hornetq.core.buffers.impl.ChannelBufferWrapper.readBytes(ChannelBufferWrapper.java:363)
      	at org.hornetq.core.client.impl.ClientMessageImpl.saveToOutputStream(ClientMessageImpl.java:151)
      	at org.jboss.as.quickstarts.jms.HelloWorldCoreConsumer.main(HelloWorldCoreConsumer.java:70)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
      	at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Issue Links

          Activity

            People

              csuconic@redhat.com Clebert Suconic
              rhn-support-abelkour Mohamed Amine Belkoura
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: