6 Replies Latest reply on Jul 27, 2015 9:31 AM by Alex Lashchuk

    Trouble with JMS and message-driven beans on WildFly 8.2.0 Final and 9.0.0 CR2

    Alex Lashchuk Newbie

      Hi all -

       

      I am looking for some help troubleshooting a JMS queue send/receive issue on WildFly 8.2.0. My issue is similar to what is described in this thread: https://developer.jboss.org/thread/235447, however the posted solution does not work for me. In a nutshell, the message queue and connection factory are created and can be injected into the application on deployment. The message is written to the queue by the sender without any errors. However, the MDB listener never receives the message. Furthermore, when the application is deployed and after the message is posted to the queue, the runtime statistics for the queue are shown as having 15 subscribers, but no messages posted and no messages waiting in the queue.

       

      After experimenting with the code for a couple of days, I was able to boil it down to a simple (and fairly boilerplate) example. The code is posted below.

       

      The sender:

      @Stateless
      @LocalBean
      public class MQTester
      {
          @Resource(mappedName = "jms/ReplyQueueConnectionFactory")
          private ConnectionFactory replyQueueConnectionFactory;
          @Resource(mappedName = "jms/ReplyQueue")
          private Queue replyQueue;
          
          @TransactionAttribute(TransactionAttributeType.REQUIRED)
          public void testMQ()
          {
              try
              {
                  Connection jmsConn = replyQueueConnectionFactory.createConnection();
                  if (jmsConn != null)
                  {
                      try
                      {
                          jmsConn.start();
                          Session jmsSession = jmsConn.createSession(true, Session.AUTO_ACKNOWLEDGE);
                          MessageProducer messageProducer = jmsSession.createProducer(replyQueue);
      
                          TextMessage message = jmsSession.createTextMessage();
                          message.setText("Message Text");
                          messageProducer.send(message);
                      }
                      finally
                      {
                          jmsConn.close();
                      }
                  }
              }
              catch(JMSException ex)
              {
                  System.err.println("Error sending message: " + ex);
              }        
          }
      }
      

       

      The listener:

      @MessageDriven(mappedName = "jms/ReplyQueue", activationConfig =  {
              @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
              @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
          })
      @TransactionManagement(value=TransactionManagementType.CONTAINER)
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      public class MQReceiver implements MessageListener
      {
          @Override
          @TransactionAttribute(TransactionAttributeType.REQUIRED)
          public void onMessage(Message message)
          {
              TextMessage txtMsg = (TextMessage) message;
              try
              {
                  System.out.println(txtMsg.getText());
              }
              catch (Exception ex)
              {
                  System.err.println("Error receiving message: " + ex);
              }
          }
      }
      

       

      Properties defined in jboss-ejb3.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
                     xmlns="http://java.sun.com/xml/ns/javaee"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xmlns:s="urn:security:1.1"
                     xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
                     version="3.1"
                     impl-version="2.0">
          <enterprise-beans>
              <session>
                  <ejb-name>MQTester</ejb-name>
                  <resource-ref>
                      <res-ref-name>jms/ReplyQueue</res-ref-name>
                      <jndi-name>java:/jms/ReplyQueue</jndi-name>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jms/ReplyQueueConnectionFactory</res-ref-name>
                      <jndi-name>java:/jms/ReplyQueueConnectionFactory</jndi-name>
                  </resource-ref>
              </session>
              <message-driven>
                  <ejb-name>MQReceiver</ejb-name>
                  <activation-config>
                       <activation-config-property>
                          <activation-config-property-name>destination</activation-config-property-name>
                          <activation-config-property-value>java:/jms/ReplyQueue</activation-config-property-value>
                       </activation-config-property>
                  </activation-config>
              </message-driven>        
          </enterprise-beans>
      </jboss:ejb-jar>
      

       

      Both the sender and the MDB are deployed in the same EJB jar inside of an EAR archive, and there is also a web application in the same EAR, which calls the testMQ method of the sender on button click.

       

      The connection factory uses the in-vm connector.

       

      I've tried playing around with JNDI names of the queues and with transaction options to no avail. I was able to turn on trace logging in HornetQ and, according to the logs, the message is sent to the queue successfully. I can post the relevant log entries if it helps.

       

      Can anyone provide any insight into what may be going on? Is it a problem that both the sender and the listener are part of the same deployment unit? Are there any transactional options that I am not supplying properly? I should probably mention that I've had similar code working on GlassFish for several years now, so at least superficially it should be functional. I've checked both WildFly 8.2.0 and 9.0.0 CR2, and both exhibit the same behavior.

       

      Thanks in advance for your help,

       

      Alex

        • 1. Re: Trouble with JMS and message-driven beans on WildFly 8.2.0 Final and 9.0.0 CR2
          Justin Bertram Master

          The first thing that jumps out at me is that you're using a transacted session but not calling commit() on the session when you're finished.

           

          Also, are you using a pooled-connection-factory to send your messages?  If not, you should be.

          • 2. Re: Trouble with JMS and message-driven beans on WildFly 8.2.0 Final and 9.0.0 CR2
            Alex Lashchuk Newbie

            Justin,

             

            Thank you very much for taking the time to answer my question. Adding a call to commit() fixed the problem. It appears that the call is needed even if the transaction attributes are changed to NOT_SUPPORTED on both the sender and the listener.

             

            Thanks again for your help,

             

            Alex

            • 3. Re: Trouble with JMS and message-driven beans on WildFly 8.2.0 Final and 9.0.0 CR2
              Justin Bertram Master

              It appears that the call is needed even if the transaction attributes are changed to NOT_SUPPORTED on both the sender and the listener.

              I believe this is true because you are not using a pooled-connection-factory (which is JCA based) so the transaction attribute is effectively ignored during the JMS operation.  If you used a pooled-connection-factory then your transaction attribute would be honored and you wouldn't need to use a transacted session or call commit in any circumstance.

              • 4. Re: Trouble with JMS and message-driven beans on WildFly 8.2.0 Final and 9.0.0 CR2
                Alex Lashchuk Newbie

                Thanks, Justin, I changed the connection-factory entries to pooled-connection-factory and am now able to send messages to the queues within transactions. I did not realize that WildFly GUI management app created connection-factory entries instead of pooled-connection-factory. After fixing the XML, everything worked.

                 

                Peeling this onion though, I am left with one issue. Database transactions started by EJBs, which are invoked from the MDB listener in the production app log the following exception entries on commit (my apologies for the lengthy stack trace, I thought it might be helpful):

                 

                2015-07-24 16:00:00,867 INFO  [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (Thread-6 (HornetQ-client-global-threads-1579273187)) IJ000311: Throwable from unregister connection: java.lang.IllegalStateException: IJ000152: Trying to return an unknown connection: org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7@1e3b940e
                    at org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl.unregisterConnection(CachedConnectionManagerImpl.java:385) [ironjacamar-core-impl-1.1.9.Final.jar:1.1.9.Final]
                    at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.connectionClosed(TxConnectionListener.java:624) [ironjacamar-core-impl-1.1.9.Final.jar:1.1.9.Final]
                    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.closeHandle(BaseWrapperManagedConnection.java:581)
                    at org.jboss.jca.adapters.jdbc.WrappedConnection.close(WrappedConnection.java:265)
                    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.closeDatasourceConnection(DatabaseAccessor.java:493) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
                    at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.closeConnection(DatasourceAccessor.java:520) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
                    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.closeConnection(DatabaseAccessor.java:518) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
                    at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.closeJTSConnection(DatasourceAccessor.java:187) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
                    at org.eclipse.persistence.sessions.server.ClientSession.releaseJTSConnection(ClientSession.java:160) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
                    at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:175) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
                    at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:68) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
                    at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
                    at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:358)
                    at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:91)
                    at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
                    at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1166)
                    at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
                    at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:93) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:340) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
                    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:439)
                    at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
                    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
                    at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                    at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
                    at net.buildinglogix.is.comms.ReplyMessageProcessor$$$view51.processMessageFragment(Unknown Source) [ISCore.jar:]
                    at net.buildinglogix.is.comms.ReplyProcessor.processRepliesForClient(ReplyProcessor.java:99) [ISCore.jar:]
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_51]
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_51]
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_51]
                    at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_51]
                    at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
                    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
                    at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
                    at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                    at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:260) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.notSupported(CMTTxInterceptor.java:324) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:237) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
                    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:439)
                    at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
                    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
                    at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                    at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
                    at net.buildinglogix.is.comms.ReplyProcessor$$$view58.processRepliesForClient(Unknown Source) [ISCore.jar:]
                    at net.buildinglogix.is.comms.ReplyHandler.onMessage(ReplyHandler.java:51) [ISCore.jar:]
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_51]
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_51]
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_51]
                    at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_51]
                    at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
                    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
                    at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
                    at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                    at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:260) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.notSupported(CMTTxInterceptor.java:324) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:237) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentDescription$5$1.processInvocation(MessageDrivenComponentDescription.java:211) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
                    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:439)
                    at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
                    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
                    at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                    at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
                    at net.buildinglogix.is.comms.ReplyHandler$$$view112.onMessage(Unknown Source) [ISCore.jar:]
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_51]
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_51]
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_51]
                    at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_51]
                    at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:139) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
                    at net.buildinglogix.is.comms.ReplyHandler$$$endpoint2.onMessage(Unknown Source) [ISCore.jar:]
                    at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:321)
                    at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1116)
                    at org.hornetq.core.client.impl.ClientConsumerImpl.access$500(ClientConsumerImpl.java:56)
                    at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1251)
                    at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:104)
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
                    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
                

                 

                I should mention that I am using EclipseLink instead of Hibernate, but it seems to me that the JDBC connection used by JPA is somehow closed before the transaction commits. My code does not explicitly open and close connections and all transactions are container-managed. Searching for similar issues, I only found a reference to a scenario, which uses nested REQUIRES_NEW transactions, which is not the case in the code I'm working with. Could you provide any insight into why this is happening? This exception is not being thrown, it is just logged.

                 

                Thanks again,

                 

                Alex

                • 5. Re: Trouble with JMS and message-driven beans on WildFly 8.2.0 Final and 9.0.0 CR2
                  Justin Bertram Master

                  I don't know exactly why you'd be getting that particular exception.  It's been ages since I've worked with JDBC datasources.  However, I will say that if you're your MDB is using a transaction itself and that transaction covers the database transaction then that will turn into an XA transaction (since multiple resources will be enlisted) so you should ensure that your JDBC datasource is configured appropriately to support XA.  Aside from that you should probably start a new thread to get the input of others who have more expertise here.

                  • 6. Re: Trouble with JMS and message-driven beans on WildFly 8.2.0 Final and 9.0.0 CR2
                    Alex Lashchuk Newbie

                    Thanks, Justin. I will do a bit more experimentation and start a new thread if I still can't figure it out.

                     

                    Thanks again for all your help,

                     

                    Alex