Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6528

MDB - Failed to acquire the pool semaphore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • No Release
    • JBossAS-4.2.2.GA
    • None
    • None

      See linked issue JBAS-1599. The original bug was for SLSB, but it still affects MDBs. We have three MDBs configured with the following activation spec:

      @MessageDriven(activationConfig =
      {
      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
      @ActivationConfigProperty(propertyName="maximumRedeliveries", propertyValue="0"),
      @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge")
      })
      @Depends(

      {"client.project:service=ProjectAppManager"}

      )
      @ResourceAdapter("activemq-rar.rar")
      @PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=1, timeout=30000)
      public class StatusMessageMDB implements MessageListener{
      ...
      }

      All three MDBs have different names, and listen on different queues, but they are configured the same. In the PoolClass annotation, we are using a maxSize of 1 in an attempt to force processing of messages in the order they were loaded on the queue.

      We loaded two of the queues with 500 messages each. One queue processes 2-3 messages per second, we will call this the "fast" queue. The other queue, the "slow" queue, takes about 5 seconds per message. The slow queue threw the following exception 5 times during the period of time both queues were loaded with messages. Curiously, the slow queue did not seem to throw this exception once the fast queue had finished its 500 messages.

      2009-02-19 11:19:47,470 ERROR [ActiveMQSession] error dispatching message:
      javax.ejb.EJBException: Failed to acquire the pool semaphore, strictTimeout=30000
      at org.jboss.ejb3.StrictMaxPool.get(StrictMaxPool.java:122)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:249)
      at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
      at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
      at $Proxy235.onMessage(Unknown Source)
      at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:116)
      at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:59)
      at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:695)
      at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
      at java.lang.Thread.run(Thread.java:595)

      I am posting this bug report here because in the comments field of JBAS-1599 there were a couple of other people who had a similar issue with MDBs and the StrictMaxPool.

              Unassigned Unassigned
              eidolon1138 David Goodman (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: