2 Replies Latest reply on Apr 17, 2007 12:15 PM by timfox

    MDB/JCA adapter connection failures

    bill.burke

      http://jira.jboss.com/jira/browse/JBMESSAGING-930

      I'm running a unit test in Embedded JBoss. Works fine most of the times. Randomly I'm getting the stack trace shown in 930 and no messages are ever delivered to the MDB.

      If I put a sleep after deployment of the MDB and Queue, everything works fine. The MDB also has an explicit dependency on the queue so it starts after the Queue starts.

      The only way I understand that this could happen is if the JMS inflow adapter tries to connect to Messaging in the background, or Queue initialization happens in a different thread. The is some race condition here obviously.

      Any insight?

      Thanks

        • 1. Re: MDB/JCA adapter connection failures

          This looks like an error in the MDB container or the resource adapter.

          The first error says the consumer can't deliver the message
          because the server session pool is not started:

          ERROR 28-03 17:15:21,093 (JmsServerSessionPool.java:getServerSession:141) -Unable to get a server session
          java.lang.Exception: Cannot get a server session after the pool is stopped
          at org.jboss.resource.adapter.jms.inflow.JmsServerSessionPool.getServerSession(JmsServerSessionPool.java:118)
          at org.jboss.jms.client.JBossConnectionConsumer.run(JBossConnectionConsumer.java:272)
          at java.lang.Thread.run(Thread.java:595)
          


          What I don't see is an invocation of the ExceptionListener
          when it encounters this problem, instead it just logs a warning:
          WARN 28-03 17:15:21,093 (JBossConnectionConsumer.java:run:303) -Connection consumer closing due to error in listening thread JBossConnectionConsumer[22, 1]
          javax.jms.JMSException: Unable to get a server session java.lang.Exception: Cannot get a server session after the pool is stopped
          

          which is useless for recovery.

          The rest of the log is NOISE that should not be there.
          Why log an error during close at ERROR level? It should be DEBUG
          at most, otherwise the user is not going to understand what the real problem is
          (in this case, it was already broken) - like Bill didn't,
          "Error closing a session" is not the problem it is a symptom.

          • 2. Re: MDB/JCA adapter connection failures
            timfox

             

            "adrian@jboss.org" wrote:

            What I don't see is an invocation of the ExceptionListener
            when it encounters this problem, instead it just logs a warning:
            WARN 28-03 17:15:21,093 (JBossConnectionConsumer.java:run:303) -Connection consumer closing due to error in listening thread JBossConnectionConsumer[22, 1]
            javax.jms.JMSException: Unable to get a server session java.lang.Exception: Cannot get a server session after the pool is stopped
            

            which is useless for recovery.


            So we should call the connection's exception listener in this situation?

            I'm just querying this since this code was more or less ported from the JBoss MQ connection consumer which doesn't call the exception listener either.