1 Reply Latest reply on Aug 31, 2012 1:07 AM by roko98

    IJ000453: Unable to get managed connection for java:/JmsXA after 20 invocations

    roko98

      Hi

       

      Just starting with Jboss7.  I have a WS that sends a JMS message to an MDB:

       

      @WebService
      public class SmsService extends com.ilg.sms.util.SmsService {
      
          @WebMethod
          public String sendSMS(
                  @WebParam(name = "to")String to, 
                  @WebParam(name = "text")String text, 
                  @WebParam(name = "country")String country, 
                  @WebParam(name = "customer")String customer) {
      ...
      
          @Resource(mappedName="java:/JmsNonXA")
          private ConnectionFactory connectionFactory;
          @Resource(mappedName = "java:/jms/queue/sms")
          private Destination receiverQueue;
      
          protected void sendMessage(String to, String text, String country, String customer) throws JMSException {        Connection connection = connectionFactory.createConnection();
              Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
              MessageProducer producer = session.createProducer(receiverQueue);
              MapMessage mapMessage = session.createMapMessage();
              mapMessage.setString("to", to);
              mapMessage.setString("text", text);
              mapMessage.setString("country", country);
              mapMessage.setString("customer", customer);
              producer.send(mapMessage);
      

       

       

      @MessageDriven(
              activationConfig = { 
                  @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
                  @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/queue/sms"),
              })
      
      public class SmsService implements MessageListener {
      
          @Override
          public void onMessage(Message message) {
              MapMessage mapMessage = (MapMessage)message;
              doSomeWork(mapMessage);
          }
      

       

      Everything works fine until the 20th invocation.  On 21th, the request hangs, and latter throws this:

       

      Could not create a session: IJ000453: Unable to get managed connection for java:/JmsXA,"err":"javax.jms.JMSException: Could not create a session: IJ000453: Unable to get managed connection for java:/JmsXA
       at org.hornetq.ra.HornetQRASessionFactoryImpl.allocateConnection(HornetQRASessionFactoryImpl.java:881)
       at org.hornetq.ra.HornetQRASessionFactoryImpl.createSession(HornetQRASessionFactoryImpl.java:470)
       at com.ilg.sms.util.SmsService.sendMessage(SmsService.java:26)
      

       

      I'm using the regular standalone.xml plus some settings for messaging.  I notice that:

       

      <mdb>
          <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
          <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
      </mdb>
      <pools>
          <bean-instance-pools>
              <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
              <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
          </bean-instance-pools>
      </pools>
      

       

      What I'm missing ? why the connections are not released after the method returns ?