0 Replies Latest reply on Apr 29, 2014 4:41 PM by Fabien Sanglier

    jboss eap 6.1 - generic-jms ra: WARN when closing connection in MDB?

    Fabien Sanglier Newbie

      Using the Generic JMS RA code found on github (jbertram/generic-jms-ra · GitHub), I've been able to successfully setup a resource adapter with my custom JMS broker (http://terracotta.org/products/universal-messaging)...and created MDBs to consume messages from it...

      It all works great...

       

      But when I try to send a message in the MDB in the same way identified below (transactionnal + JMS XAConnection factory), it seems to work (receiving the messages etc...), BUT I get a WARN message (ResourceException cleaning up managed connection: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@1d876c81) each time I'm closing that managed connection...so I'm concerned that something is not right (and probably some sort of performance issue)

      So based on that, I think I'm doing something wrong here...as I should not see that WARN message at all...the JCA implementation taking care of not closing the underlying connection...

      Any ideas?

       

      @MessageDriven(activationConfig = {
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "/queue/source"),
        @ActivationConfigProperty(propertyName = "jndiParameters", propertyValue = "java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory;java.naming.provider.url=JBM_HOST:1099;java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces"),
        @ActivationConfigProperty(propertyName = "connectionFactory", propertyValue = "XAConnectionFactory")
      })
      @ResourceAdapter("generic-jms-ra-<VERSION>.rar")
      public class ExampleMDB implements MessageListener
      {

        @Resource
        private MessageDrivenContext context;

        public void onMessage(final Message message)
        {
        Connection connection = null;

        try
        {
        Context context = new InitialContext();
        ConnectionFactory cf = (ConnectionFactory) context.lookup("java:/GenericJmsXA");
        context.close();
        connection = cf.createConnection();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination destination = session.createQueue("target");
        MessageProducer producer = session.createProducer(destination);
        Message msg = session.createTextMessage("example text");
        producer.send(msg);
        }
        catch (Exception e)
        {
        context.setRollbackOnly();
        }
        finally
        {
        if (connection != null)
        {
        connection.close();
        }
        }
        }
      }

       

       

      16:21:33,244 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri] (Client-Push:3:0) IJ000607: ResourceException cleaning up managed connection: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@1d876c81[state=NORMAL managed connection=org.jboss.resource.adapter.jms.JmsManagedConnection@6c78be9c connection handles=0 lastUse=1398802893239 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri@198b9c5b pool internal context=SemaphoreArrayListManagedConnectionPool@1cc62777[pool=JbossGenericJmsManagedFactory] xaResource=XAResourceWrapperImpl@25e4984c[xaResource=org.jboss.resource.adapter.jms.JmsXAResource@42cab903 pad=false overrideRmValue=null productName=JBoss Generic JMS JCA Resource Adapter productVersion=0.1 jndiName=java:/jms/JbossGenericJmsManagedFactory] txSync=null]: javax.resource.ResourceException: Cleaning up org.jboss.resource.adapter.jms.JmsManagedConnection@6c78be9c bound to clientID = 127.0.0.1:63252

        at org.jboss.resource.adapter.jms.JmsManagedConnection.cleanup(JmsManagedConnection.java:342) [generic-jms-ra-jar-1.0.5.Final-SNAPSHOT.jar:1.0.5.Final-SNAPSHOT]

        at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.returnConnection(SemaphoreArrayListManagedConnectionPool.java:435)

        at org.jboss.jca.core.connectionmanager.pool.AbstractPool.returnConnection(AbstractPool.java:561)

        at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.returnManagedConnection(AbstractConnectionManager.java:425)

        at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.connectionClosed(TxConnectionListener.java:387)

        at org.jboss.resource.adapter.jms.JmsManagedConnection.sendEvent(JmsManagedConnection.java:565) [generic-jms-ra-jar-1.0.5.Final-SNAPSHOT.jar:1.0.5.Final-SNAPSHOT]

        at org.jboss.resource.adapter.jms.JmsSession.closeSession(JmsSession.java:702) [generic-jms-ra-jar-1.0.5.Final-SNAPSHOT.jar:1.0.5.Final-SNAPSHOT]

        at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.close(JmsSessionFactoryImpl.java:262) [generic-jms-ra-jar-1.0.5.Final-SNAPSHOT.jar:1.0.5.Final-SNAPSHOT]

        at org.jboss.as.messaging.genericjms.SimpleQueueReplyBean.sendMessage2(SimpleQueueReplyBean.java:152) [classes:]

        at org.jboss.as.messaging.genericjms.SimpleQueueReplyBean.onMessage(SimpleQueueReplyBean.java:87) [classes:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_21]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21]

        at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21]

        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:235) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.supports(CMTTxInterceptor.java:374) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:218) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentDescription$5$1.processInvocation(MessageDrivenComponentDescription.java:196) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at javax.jms.MessageListener$$$view4.onMessage(Unknown Source) [jboss-jms-api_1.1_spec-1.0.1.Final-redhat-2.jar:1.0.1.Final-redhat-2]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_21]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21]

        at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21]

        at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:140) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at com.sun.proxy.$Proxy10.onMessage(Unknown Source)

        at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:163) [generic-jms-ra-jar-1.0.5.Final-SNAPSHOT.jar:1.0.5.Final-SNAPSHOT]

        at com.pcbsys.nirvana.nJMS.MessageConsumerImpl.go(MessageConsumerImpl.java:1152) [nJMS.jar:]

        at com.pcbsys.nirvana.client.nQueueAsyncReader$eventConsumerWrapper.go(nQueueAsyncReader.java:218) [nServer.jar:]

        at com.pcbsys.nirvana.base.nClientChannelList.pushCallback(nClientChannelList.java:348) [nServer.jar:]

        at com.pcbsys.nirvana.base.nClientChannelList.access$600(nClientChannelList.java:32) [nServer.jar:]

        at com.pcbsys.nirvana.base.nClientChannelList$nPushTask.handleEvent(nClientChannelList.java:581) [nServer.jar:]

        at com.pcbsys.nirvana.base.nClientChannelList$nPushTask.execute(nClientChannelList.java:613) [nServer.jar:]

        at com.pcbsys.foundation.threads.fThreadPool$WorkerThread.executeTask(fThreadPool.java:714) [nServer.jar:]

        at com.pcbsys.foundation.threads.fThreadPool$WorkerThread.runLoop(fThreadPool.java:704) [nServer.jar:]

        at com.pcbsys.foundation.threads.fThreadPool$WorkerThread.run(fThreadPool.java:744) [nServer.jar:]

        at com.pcbsys.foundation.threads.fThread.localRun(fThread.java:210) [nServer.jar:]

        at com.pcbsys.foundation.threads.hThread.run(hThread.java:93) [nServer.jar:]

        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]