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

[GSS](7.2.z) hornetq-core-client with netty in the same classloader cause an java.lang.IndexOutOfBoundsException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • 7.2.3.CR1, 7.2.3.GA
    • 7.2.0.GA
    • ActiveMQ
    • None
    • Hide

      Reproducer #1
      Use attached standalone-full.xml , deploy JBEAP-16698.war in JBoss EAP 7.2 , start ./bin/standalone.sh -c standalone-full.xml and it will throw the exception.
      ----------

      Reproducer #2

      • * 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. if code is modified to depend on "4.0.18.Final-redhat-1" instead of "4.1.25.Final-redhat-00003"(or no netty-all dependency at all), same code works.

      This affects applications that are deployed in EAP (Ears, wars, jars) that have both dependencies.

      Show
      Reproducer #1 Use attached standalone-full.xml , deploy JBEAP-16698 .war in JBoss EAP 7.2 , start ./bin/standalone.sh -c standalone-full.xml and it will throw the exception. ---------- Reproducer #2 * 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. if code is modified to depend on "4.0.18.Final-redhat-1" instead of "4.1.25.Final-redhat-00003"(or no netty-all dependency at all), same code works. This affects applications that are deployed in EAP (Ears, wars, jars) that have both dependencies.

    Description

      EAP7.2 ships with:

      • hornetq-core-client, version 2.4.7.Final-redhat-1
      • netty-all 4.1.25.Final-redhat-00003

      When invoking hornetq core API, with netty in the classpath, the following error can happen:

      ava.lang.IndexOutOfBoundsException: readerIndex(40091) + length(40000) exceeds writerIndex(40448): UnpooledUnsafeHeapByteBuf(ridx: 40091, widx: 40448, cap: 65536)
      at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1178)
      at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1172)
      at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:693)
      at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:701)
      at io.netty.buffer.WrappedByteBuf.readBytes(WrappedByteBuf.java:518)
      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.HelloWorldCoreClient.main(HelloWorldCoreClient.java:88)
      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)

      In the reproducer, changing the dependency on netty to an earlier version (such as 4.0.18.Final-redhat-1) resolves the issue, so it looks more as a netty bug. However, for apps deployed in EAP, with dependencies on both jars, the problem is unavoidable

      Attachments

        1. helloworld-core-client.zip
          11 kB
        2. JBEAP-16698.war
          7 kB
        3. standalone-full.xml
          31 kB

        Issue Links

          Activity

            People

              rhn-support-tmiyargi Teresa Miyar Gil (Inactive)
              rhn-support-abelkour Mohamed Amine Belkoura
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: