3 Replies Latest reply on Aug 30, 2007 5:48 PM by bowlere

    JBossMQ ThreadPoolFullException

    bowlere

      Hi,

      I'm running JBoss 4.2.1, with an external program delivering JMS messages to and MDB. The whole setup seems to run for a little while, but pretty soon, I start getting exceptions thrown, and after a few mins get the exceptions below. In the MDB I have a try / catch (Throwable) around the contents of onMessage in an attempt to stop any problems with my code stopping the Thread from being returned to the pool. I've tried upping the size of the threadpool, to no avail. I guess I'd like to know what circumstances would stop a thread from being returned to the pool. But mostly I just want to fix my problem ... any ideas ?

      Many Thanks

      Ed

      2007-08-29 15:15:04,662 WARN [BasicQueue] Caught unusual exception sending message to receiver.
      org.jboss.util.threadpool.ThreadPoolFullException: java.lang.InterruptedException
       at org.jboss.util.threadpool.BasicThreadPool.execute(BasicThreadPool.java:417)
       at org.jboss.util.threadpool.BasicThreadPool.runTaskWrapper(BasicThreadPool.java:192)
       at org.jboss.util.threadpool.BasicThreadPool.run(BasicThreadPool.java:212)
       at org.jboss.util.threadpool.BasicThreadPool.run(BasicThreadPool.java:206)
       at org.jboss.mq.server.ClientConsumer.queueMessageForSending(ClientConsumer.java:125)
       at org.jboss.mq.server.BasicQueue.queueMessageForSending(BasicQueue.java:1140)
       at org.jboss.mq.server.BasicQueue.internalAddMessage(BasicQueue.java:1111)
       at org.jboss.mq.server.BasicQueue.access$000(BasicQueue.java:76)
       at org.jboss.mq.server.BasicQueue$AddMessagePostCommitTask.run(BasicQueue.java:1359)
       at org.jboss.mq.pm.TxManager.addPostCommitTask(TxManager.java:162)
       at org.jboss.mq.server.BasicQueue.performOrPrepareAddMessage(BasicQueue.java:411)
       at org.jboss.mq.server.BasicQueue.addMessage(BasicQueue.java:383)
       at org.jboss.mq.server.PersistentQueue.addMessage(PersistentQueue.java:76)
       at org.jboss.mq.server.JMSQueue.addMessage(JMSQueue.java:180)
       at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:415)
       at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:399)
       at org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(JMSServerInterceptorSupport.java:106)
       at org.jboss.mq.security.ServerSecurityInterceptor.addMessage(ServerSecurityInterceptor.java:168)
       at org.jboss.mq.server.TracingInterceptor.addMessage(TracingInterceptor.java:226)
       at org.jboss.mq.server.JMSServerInvoker.addMessage(JMSServerInvoker.java:112)
       at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:114)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:395)
       at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
       at java.lang.Thread.run(Thread.java:619)
      


      2007-08-29 15:32:11,663 ERROR [BasicQueue] Caught unusual exception in nackMessage for 2379 msg=2378 hard STORED PERSISTENT queue=QUEUE.ASMGCSFlightUpdate priority=4 lateClone=false hashCode=32408976
      org.jboss.mq.SpyJMSException: Could not update the message in the database: update affected 0 rows
       at org.jboss.mq.pm.jdbc2.PersistenceManager.update(PersistenceManager.java:1298)
       at org.jboss.mq.server.BasicQueue.nackMessage(BasicQueue.java:482)
       at org.jboss.mq.server.BasicQueue$RestoreMessageTask.run(BasicQueue.java:1383)
       at org.jboss.mq.pm.TxManager.addPostCommitTask(TxManager.java:162)
       at org.jboss.mq.server.BasicQueue.acknowledge(BasicQueue.java:742)
       at org.jboss.mq.server.BasicQueue.nackMessages(BasicQueue.java:820)
       at org.jboss.mq.server.JMSQueue.nackMessages(JMSQueue.java:117)
       at org.jboss.mq.server.ClientConsumer.close(ClientConsumer.java:202)
       at org.jboss.mq.server.JMSDestinationManager.connectionClosing(JMSDestinationManager.java:525)
       at org.jboss.mq.server.JMSServerInterceptorSupport.connectionClosing(JMSServerInterceptorSupport.java:96)
       at org.jboss.mq.security.ServerSecurityInterceptor.connectionClosing(ServerSecurityInterceptor.java:77)
       at org.jboss.mq.server.TracingInterceptor.connectionClosing(TracingInterceptor.java:161)
       at org.jboss.mq.server.JMSServerInvoker.connectionClosing(JMSServerInvoker.java:102)
       at org.jboss.mq.il.jvm.JVMServerIL.connectionClosing(JVMServerIL.java:126)
       at org.jboss.mq.Connection.close(Connection.java:601)
      ..........SNIP
      


        • 1. Re: JBossMQ ThreadPoolFullException
          bowlere

          Solved

          The external app was creating a new connection for every message (DOH!). I'd copied and pasted the jms message sending code from somewhere that was running inside JBoss. That was expecting JBoss to manage a jms connection pool, whereas the external app was creating a new connection every time it sent a message. So I was running out of threads pretty quickly (even when I had the max number set at 2000). Properly synchonized access to the connection and shared it between the messages, and everything's back under control.

          • 2. Re: JBossMQ ThreadPoolFullException
            rosama77

            I think now that doesn't know what is the answer, we have to find ourselves, what do you think?.

            Greetings

            • 3. Re: JBossMQ ThreadPoolFullException
              bowlere

              Solved

              The external app was creating a new connection for every message (DOH!). I'd copied and pasted the jms message sending code from somewhere that was running inside JBoss. That was expecting JBoss to manage a jms connection pool, whereas the external app was creating a new connection every time it sent a message. So I was running out of threads pretty quickly (even when I had the max number set at 2000). Properly synchonized access to the connection and shared it between the messages, and everything's back under control.