Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-10485

Unexpected connection closing in IBM Websphere MQ TCK tests

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • TBD EAP 5
    • EAP_EWP 5.2.0 ER2, EAP_EWP 5.2.0 ER5, EAP_EWP 5.2.0 ER6
    • Messaging
    • None
    • Not Required
    • NEW

    Description

      Unexpected connection closing in IBM Websphere MQ TCK tests.
      Stateful MDB creates connection in one method and uses it in another method to send message. Between these methods calls, transaction manager unexpectedly closes current transaction and also created connection. So, when we try to send message, test fails because of closed connection.

      10 tests in TCK affected.
      https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/tck5-eap5x-jdk6-jms-ibmmq/18/testReport/unknownTestSuite.0/packageTests/com.sun.ts.tests.jms.ee.mdb.mdb_rec/
      Impact for customers
      Wrong behaviour of transactions.
      Reproducer info
      None
      Links for info how to setup IBM MQ locally
      https://docspace.corp.redhat.com/docs/DOC-114804#qi
      More detailed description
      A message-driven bean is an asynchronous message consumer. A message-driven bean is invoked by the container as a result of the arrival of a message at the destination or endpoint that is serviced by the message-driven bean.
      Stateful session bean creates a queue and topic connections with the default user identity in ejbCreate() method and starts them like this:

                   qcFactory = (QueueConnectionFactory)context.lookup("java:comp/env/jms/MyQueueConnectionFactory");
                   rcvrQueue = (Queue) context.lookup("java:comp/env/jms/MDB_QUEUE_REPLY");
                   queue = (Queue) context.lookup("java:comp/env/jms/MDB_QUEUE");
                   tcFactory = (TopicConnectionFactory)context.lookup("java:comp/env/jms/MyTopicConnectionFactory");
                   topic = (Topic) context.lookup("java:comp/env/jms/MDB_TOPIC");
                   tConn = tcFactory.createTopicConnection(jmsUser,jmsPassword);
                   connection =  qcFactory.createQueueConnection(jmsUser,jmsPassword);
                   connection.start();
                   tConn.start();
      

      But if we're trying to use created connections in other methods, we get an Exception. I tried to analyse the cause and found, that these connection were closed after transaction manager closed the current transaction (I have no idea, why) after ejbCreate() method call:

      12-06-2012 10:51:39: SVR-ERROR: com.ibm.msg.client.jms.DetailedIllegalStateException: MQJCA1019: The connection is closed.
      The application attempted to use a JMS connection after it had closed the connection.
      Modify the application so that it closes the JMS connection only after it has finished using the connection.
      at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:154)
      at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:91)
      at com.ibm.mq.connector.outbound.ConnectionWrapper.assertOpen(ConnectionWrapper.java:348)
      at com.ibm.mq.connector.outbound.QueueConnectionWrapper.createQueueSession(QueueConnectionWrapper.java:83)
      at com.sun.ts.tests.jms.ee.mdb.mdb_rec.MDB_AR_TestEJB.isThereSomethingInTheQueue(MDB_AR_TestEJB.java:94)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.invocation.Invocation.performCall(Invocation.java:386)
      at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:620)
      at org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor.invoke(StatefulSessionSecurityInterceptor.java:84)
      at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:233)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)
      at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:348)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
      at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:100)
      at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:84)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)
      at org.jboss.ejb.Container.invoke(Container.java:1092)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:586)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)

      Looking into server logs, we can find, that these connections were closed after ejbCreate() call and before another MDB's method call.

      16:51:39,098 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: com.ibm.mq.connector.outbound.QueueConnectionWrapper@9e90a6
      java.lang.Throwable: STACKTRACE
      at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:278)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:524)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
      at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConnection(ConnectionFactoryImpl.java:194)
      at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnectionInternal(ConnectionFactoryImpl.java:153)
      at com.ibm.mq.connector.outbound.QueueConnectionFactoryImpl.createQueueConnection(QueueConnectionFactoryImpl.java:137)
      at com.sun.ts.tests.jms.ee.mdb.mdb_rec.MDB_AR_TestEJB.ejbCreate(MDB_AR_TestEJB.java:75)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.ejb.StatefulSessionContainer.createSession(StatefulSessionContainer.java:288)
      at org.jboss.ejb.StatefulSessionContainer.createHome(StatefulSessionContainer.java:347)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.invocation.Invocation.performCall(Invocation.java:386)
      at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invokeHome(StatefulSessionContainer.java:564)
      at org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor.invokeHome(StatefulSessionSecurityInterceptor.java:109)
      at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:235)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:205)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:187)
      at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:149)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161)
      at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:102)
      at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invokeHome(PreSecurityInterceptor.java:91)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
      at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:639)
      at org.jboss.ejb.Container.invoke(Container.java:1109)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
      16:51:39,100 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: com.ibm.mq.connector.outbound.TopicConnectionWrapper@1fbdaef
      java.lang.Throwable: STACKTRACE
      at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:278)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:524)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
      at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConnection(ConnectionFactoryImpl.java:194)
      at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnectionInternal(ConnectionFactoryImpl.java:153)
      at com.ibm.mq.connector.outbound.TopicConnectionFactoryImpl.createTopicConnection(TopicConnectionFactoryImpl.java:137)
      at com.sun.ts.tests.jms.ee.mdb.mdb_rec.MDB_AR_TestEJB.ejbCreate(MDB_AR_TestEJB.java:74)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.ejb.StatefulSessionContainer.createSession(StatefulSessionContainer.java:288)
      at org.jboss.ejb.StatefulSessionContainer.createHome(StatefulSessionContainer.java:347)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.invocation.Invocation.performCall(Invocation.java:386)
      at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invokeHome(StatefulSessionContainer.java:564)
      at org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor.invokeHome(StatefulSessionSecurityInterceptor.java:109)
      at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:235)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:205)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:187)
      at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:149)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161)
      at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:102)
      at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invokeHome(PreSecurityInterceptor.java:91)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
      at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:639)
      at org.jboss.ejb.Container.invoke(Container.java:1109)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)

      Attachments

        Activity

          People

            rsharple@redhat.com Richard Sharples (Inactive)
            vrastsel_jira Vladimir Rastseluev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: