8 Replies Latest reply on Nov 17, 2006 9:10 AM by Taudo Wenzel

    _JMS Mesage delivery not working

    Taudo Wenzel Newbie

      Hello,
      when delivering a message, the messaging server throws the following exception:

      09:38:35,748 ERROR [ExceptionInterceptor] Caught RuntimeException
      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
       at java.util.ArrayList.RangeCheck(ArrayList.java:507)
       at java.util.ArrayList.get(ArrayList.java:324)
       at org.jboss.jms.client.container.SessionAspect.handlePostDeliver(SessionAspect.java:161)
       at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect7.invoke(SessionAspect7.java)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:182)
       at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.delegate.ClientSessionDelegate.postDeliver(ClientSessionDelegate.java)
       at org.jboss.jms.client.remoting.MessageCallbackHandler.postDeliver(MessageCallbackHandler.java:164)
       at org.jboss.jms.client.remoting.MessageCallbackHandler.callOnMessage(MessageCallbackHandler.java:139)
       at org.jboss.jms.client.remoting.MessageCallbackHandler$ListenerRunner.run(MessageCallbackHandler.java:728)
       at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java:89)
       at java.lang.Thread.run(Thread.java:534)
      09:38:35,750 ERROR [MessageCallbackHandler] Failed to deliver message
      javax.jms.IllegalStateException: Index: 0, Size: 0
       at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:91)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.delegate.ClientSessionDelegate.postDeliver(ClientSessionDelegate.java)
       at org.jboss.jms.client.remoting.MessageCallbackHandler.postDeliver(MessageCallbackHandler.java:164)
       at org.jboss.jms.client.remoting.MessageCallbackHandler.callOnMessage(MessageCallbackHandler.java:139)
       at org.jboss.jms.client.remoting.MessageCallbackHandler$ListenerRunner.run(MessageCallbackHandler.java:728)
       at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java:89)
       at java.lang.Thread.run(Thread.java:534)
      09:38:35,783 ERROR [ExceptionInterceptor] Caught RuntimeException
      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
       at java.util.ArrayList.RangeCheck(ArrayList.java:507)
       at java.util.ArrayList.get(ArrayList.java:324)
       at org.jboss.jms.client.container.SessionAspect.handlePostDeliver(SessionAspect.java:161)
       at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect7.invoke(SessionAspect7.java)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:182)
       at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
       at org.jboss.jms.client.delegate.ClientSessionDelegate$postDeliver_6688653097097482359.invokeNext(ClientSessionDelegate$postDeliver_6688653097097482 359.java)
       at org.jboss.jms.client.delegate.ClientSessionDelegate.postDeliver(ClientSessionDelegate.java)
       at org.jboss.jms.client.remoting.MessageCallbackHandler.postDeliver(MessageCallbackHandler.java:164)
       at org.jboss.jms.client.remoting.MessageCallbackHandler.callOnMessage(MessageCallbackHandler.java:139)
       at org.jboss.jms.client.remoting.MessageCallbackHandler$ListenerRunner.run(MessageCallbackHandler.java:728)
       at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java:89)
       at java.lang.Thread.run(Thread.java:534)
      09:38:35,784 ERROR [MessageCallbackHandler] Failed to deliver message
      


      I am using Messaging 1.0.1 GA with JBoss AS 4.0.5 GA and a Sybase ASE Database for reliable messages.

      Could you give me some hints as to where to look for?

      Mayn Thanks,
      Taudo

        • 1. Re: _JMS Mesage delivery not working
          Clebert Suconic Master

          we need more information:

          - what version you are using?
          - An example of how you are doing thigs with a description of your environment. (single node, different nodes). A testcase would also help.


          Clebert Suconic

          • 2. Re: _JMS Mesage delivery not working
            Taudo Wenzel Newbie

            Hi Clebert!
            The Version information is contained in my original post.
            This happens when sending a JMS message to a topic from within a stateless session bean. Do I need to watch something special when using JMS from within a Stateless EJB?

            Thanks!

            • 3. Re: _JMS Mesage delivery not working
              Clebert Suconic Master

              It looks like you have an instalation problem. Probably something about the classLoading isolation in your applications.

              • 4. Re: _JMS Mesage delivery not working
                Taudo Wenzel Newbie

                I deployed the EJB's and a web app in an ear with the following jboss-app.xml in META-INf dir:

                jboss-app>
                 <loader-repository>jboss.messaging:loader=ScopedLoaderRepository
                 <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
                 </loader-repository>
                 <module>
                 <service>bootstrap.sar</service>
                 </module>
                </jboss-app>
                
                


                This should actually work!
                Class SessionAspect at line 161 is throwing the index out of bounds exception. This is thrown because there are now acknowledgements for this message. Do you have any hints what causes this?


                • 5. Re: _JMS Mesage delivery not working
                  Taudo Wenzel Newbie

                  ...I forgot to add that the messages are auto acknowledged.

                  • 6. Re: _JMS Mesage delivery not working
                    Taudo Wenzel Newbie

                    Thanks for the help so far.
                    The code in Class SessionAspect line 161 is interesting. You are using an array for the acknowledgements and hardcode to use array index "0"? In my case it happens that the array of acknowledgements is empty, hence the Array out of bounds exception.
                    If someone who wrote that code could give a hint why that is this way?
                    I mean you must have been pretty sure that there will be at least one element contained in this array, so I think the reason that the array is empty should be easily to figure out for you guys, shouldn't it?
                    The strange thing is, the messages get delivered anyways, it just throws this exception when I am sending messages from within a stateless session bean. I can not give something into production that works but throws Exception no one can explain.

                    I am sorry, but I can't post more code here as this is a large financial trading application with it's own messaging layer that I am trying to port to JBoss (currently running smoothless under Weblogic since three years...).
                    That would be to much code to post here...

                    • 7. Re: _JMS Mesage delivery not working
                      Tim Fox Master

                       

                      "oleznew" wrote:
                      Thanks for the help so far.
                      The code in Class SessionAspect line 161 is interesting. You are using an array for the acknowledgements and hardcode to use array index "0"? In my case it happens that the array of acknowledgements is empty, hence the Array out of bounds exception.
                      If someone who wrote that code could give a hint why that is this way?
                      I mean you must have been pretty sure that there will be at least one element contained in this array,


                      For auto ack there should always be exactly one element in the array

                      I have seen a similar (same) problem before where the user was using the same session concurrently with more than one thread (this is prohibited as per JMS spec) and the ack list was getting cleared by one thread, then when the second one went to ack it got an exception since it couldn't find the element like you are seeing.

                      Can you confirm you aren't sharing the session between multiple threads?

                      Can you also replicate this in a small test or code sample that I could try out?

                      Thanks.

                      • 8. Re: _JMS Mesage delivery not working
                        Taudo Wenzel Newbie

                        Yes I can confirm that this is not a threading issue.
                        I'll prepare a test case.

                        Thanks