org.jboss.resource.adapter.jms.JmsSessionFactoryImpl - Could not create a session

363 views
Skip to first unread message

Ahmed Theba

unread,
Feb 22, 2017, 10:02:31 AM2/22/17
to Generic JMS JCA Resource Adapter for JBoss AS
Hi,

I pulled from branch 2.0.0-Alpha2 and ran this on a vanilla JBoss EAP 7 with the tibco module (version 8.2) installed.

The resource adapter deploys correctly but my jms send test fails with the following exception:

could not create session: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected()
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:933)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:750)
at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.allocateConnection(Unknown Source)
at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createSession(Unknown Source)

I'm unsure if this is an issue with the resource adapter or with EAP 7? Looking for some help to point me in the right direction.

Justin Bertram

unread,
Feb 22, 2017, 11:31:56 AM2/22/17
to Generic JMS JCA Resource Adapter for JBoss AS
Can you provide any additional information?  The stack-trace doesn't look complete and it doesn't even contain line numbers.  Also, you haven't provided any details on your use-case or configuration.  It's not really possible to help with the information you've provided so far.  As always, reproducible test-cases are the best way to help us help you.

Ahmed Theba

unread,
Feb 23, 2017, 4:00:01 AM2/23/17
to Generic JMS JCA Resource Adapter for JBoss AS
Hi,

JDK: 1.8.0_77
Server: EAP 7.0.4
Tibco (com.tibco.tibjms): tibjms.jar (version 8.2.2)

Here is the complete stack-trace:

10:54:29,439 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0009: Starting weld service for deployment TibcoTest.jar
10:54:29,877 INFO  [stdout] (ServerService Thread Pool -- 65) SingleTon called...

10:54:32,407 ERROR [stderr] (ServerService Thread Pool -- 65) java.lang.NullPointerException

10:54:32,409 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.jca.core.tx.jbossts.XAResourceWrapperImpl.setTransactionTimeout(XAResourceWrapperImpl.java:204)

10:54:32,410 ERROR [stderr] (ServerService Thread Pool -- 65) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:637)

10:54:32,412 ERROR [stderr] (ServerService Thread Pool -- 65) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:423)

10:54:32,413 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.enlist(TxConnectionListener.java:986)

10:54:32,415 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:379)

10:54:32,416 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:553)

10:54:32,418 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:928)

10:54:32,419 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:750)

10:54:32,421 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.allocateConnection(Unknown Source)

10:54:32,422 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createSession(Unknown Source)

10:54:32,424 ERROR [stderr] (ServerService Thread Pool -- 65) at za.co.disco.mdb.SingleTonEJB.sendMessage(SingleTonEJB.java:66)

10:54:32,425 ERROR [stderr] (ServerService Thread Pool -- 65) at za.co.disco.mdb.SingleTonEJB.init(SingleTonEJB.java:90)

10:54:32,427 ERROR [stderr] (ServerService Thread Pool -- 65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

10:54:32,428 ERROR [stderr] (ServerService Thread Pool -- 65) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

10:54:32,429 ERROR [stderr] (ServerService Thread Pool -- 65) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

10:54:32,431 ERROR [stderr] (ServerService Thread Pool -- 65) at java.lang.reflect.Method.invoke(Method.java:498)

10:54:32,432 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)

10:54:32,434 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,435 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114)

10:54:32,437 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103)

10:54:32,438 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,440 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

10:54:32,441 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)

10:54:32,443 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)

10:54:32,444 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,445 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)

10:54:32,447 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,448 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:107)

10:54:32,450 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,451 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)

10:54:32,453 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,454 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)

10:54:32,456 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,457 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:100)

10:54:32,459 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,461 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

10:54:32,462 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,464 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)

10:54:32,465 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:349)

10:54:32,467 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:68)

10:54:32,468 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,469 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)

10:54:32,471 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,472 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

10:54:32,474 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,475 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)

10:54:32,477 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,478 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

10:54:32,480 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,481 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ejb3.component.singleton.StartupCountDownInterceptor.processInvocation(StartupCountDownInterceptor.java:25)

10:54:32,483 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,484 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

10:54:32,485 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

10:54:32,487 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

10:54:32,488 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

10:54:32,490 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)

10:54:32,491 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)

10:54:32,493 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)

10:54:32,494 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:124)

10:54:32,496 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:138)

10:54:32,497 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)

10:54:32,499 ERROR [stderr] (ServerService Thread Pool -- 65) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

10:54:32,500 ERROR [stderr] (ServerService Thread Pool -- 65) at java.util.concurrent.FutureTask.run(FutureTask.java:266)

10:54:32,502 ERROR [stderr] (ServerService Thread Pool -- 65) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

10:54:32,503 ERROR [stderr] (ServerService Thread Pool -- 65) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

10:54:32,504 ERROR [stderr] (ServerService Thread Pool -- 65) at java.lang.Thread.run(Thread.java:745)

10:54:32,506 ERROR [stderr] (ServerService Thread Pool -- 65) at org.jboss.threads.JBossThread.run(JBossThread.java:320)

10:54:32,508 ERROR [org.jboss.resource.adapter.jms.JmsSessionFactoryImpl] (ServerService Thread Pool -- 65) could not create session: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@7ad42aee[state=NORMAL managed connection=org.jboss.resource.adapter.jms.JmsManagedConnection@56583364 connection handles=0 lastReturned=1487840072508 lastValidated=1487840072390 lastCheckedOut=1487840072390 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri@1add60bb mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@19a41dc8[pool=TibcoJMSXA] xaResource=XAResourceWrapperImpl@7748b105[xaResource=null pad=false overrideRmValue=null productName=JBoss Generic JMS JCA Resource Adapter productVersion=0.1 jndiName=java:/jms/TibcoJMSXA] txSync=null]
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:933)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:750)
at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.allocateConnection(Unknown Source)
at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createSession(Unknown Source)
at za.co.disco.mdb.SingleTonEJB.sendMessage(SingleTonEJB.java:66)
at za.co.disco.mdb.SingleTonEJB.init(SingleTonEJB.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:107)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:100)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:349)
at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:68)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.singleton.StartupCountDownInterceptor.processInvocation(StartupCountDownInterceptor.java:25)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)
at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)
at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:124)
at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:138)
at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: javax.resource.ResourceException: IJ000461: Could not enlist in transaction on entering meta-aware object
at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:560)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:928)
... 60 more
Caused by: javax.transaction.SystemException: IJ000356: Failed to enlist: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 0:ffffac191f56:-6acf7dfa:58aea342:b status: ActionStatus.ABORT_ONLY >
at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.checkEnlisted(TxConnectionListener.java:943)
at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:394)
at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:553)
... 61 more

Ahmed Theba

unread,
Feb 23, 2017, 4:03:15 AM2/23/17
to Generic JMS JCA Resource Adapter for JBoss AS
Test EJB singleton used to test JMS 1.1 compatibility (works on EAP 6 and older generic-jms-ra build):

@Singleton
@Startup
public class SingleTonEJB
{
  @Resource(mappedName = "java:/jms/TibcoJMSXA")
  private ConnectionFactory connectionFactory;
  private String queueName = "Q.ZA.ILSA.ESB.integration.test";

  public SingleTonEJB()
  {

  }
  
  private void closeAll(Connection con, Session session, MessageProducer mp){
    if(mp!=null){
      try{
        mp.close();
      }catch(JMSException e){
        //log me
      }
    }
    if(session!=null){
      try{
        session.close();
      }catch(JMSException e){
        //log me
      }
    }
    if(con!=null){
      try{
        con.close();
      }catch(JMSException e){
        //log me
      }
    }
  }

  private void sendMessage()
  {
    try
    {
      //ConnectionFactory connectionFactory = getConnFactory();
      Connection conn = connectionFactory.createConnection();
      Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      Queue queue = session.createQueue(queueName);
      MessageProducer mp = session.createProducer(queue);
      System.out.println("Sending tibco message(s).");
      int i = 9;
      while(i>0){
        TextMessage textMessage = session.createTextMessage();
        textMessage.setText("Hello world!" + (int) (Math.random() * 100));
        mp.send(textMessage);
        i--;
      }
      System.out.println("Sent messages!");
      closeAll(conn, session, mp);
    }
    catch (Exception e)
    {
      System.out.println("Bollocks!" + e.getMessage());
    }
  }

  @PostConstruct
  public void init()
  {
    System.out.println("SingleTon called...");
    sendMessage();
    System.out.println("Done!");
  }

}

Justin Bertram

unread,
Feb 23, 2017, 9:38:07 AM2/23/17
to Generic JMS JCA Resource Adapter for JBoss AS
After a quick Google search I found this.  It appears this change went into the resource adapter such that now it is imperative that you follow the Java EE specification recommendations when creating your JMS sessions in a transactional context (e.g. as you are).  Instead of using this:

Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

Try using this:

Session session = conn.createSession(true, Session.TRANSACTED);

Ahmed Theba

unread,
Feb 23, 2017, 9:55:43 AM2/23/17
to Generic JMS JCA Resource Adapter for JBoss AS
Ahh yes... this works now.

I assumed the behavior in an EE JMS 2.0 environment would be the same as JMS 1.1 i.e. to ignore the two parameters. This is the case with the new one parameter method:


The second problem with the createSession method in JMS 1.1 is that in a Java EE Web or EJB application, if there is a current JTA transaction (as there is by default), both parameters to createSession are ignored anyway. However, since the API forced developers to specify two parameters, which led to highly misleading code, a user writing an EJB bean might write the following code in not realizing that the session would actually use the EJB's container-managed JTA transaction.

Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);

To address these problems, two new methods with the name createSession have been added to javax.jms.Connection. One has a single parameter and one has no parameters at all. We'll discuss these in turn.


JMS 2.0: createSession with One Parameter

In JMS 2.0, a second createSession method has been added to javax.jms.Connection. This has a single parameter, sessionMode:

Session createSession(int sessionMode) throws JMSException

In a normal Java SE environment, sessionMode can be set to Session.AUTO_ACKNOWLEDGESession.CLIENT_ACKNOWLEDGESession.DUPS_OK_ACKNOWLEDGE, or Session.TRANSACTED. In a Java EE transaction, sessionMode is ignored.




Justin Bertram

unread,
Feb 23, 2017, 12:41:48 PM2/23/17
to Generic JMS JCA Resource Adapter for JBoss AS
Glad it's working for you now.
Message has been deleted
Message has been deleted

Ahmed Theba

unread,
Feb 28, 2017, 7:20:03 AM2/28/17
to Generic JMS JCA Resource Adapter for JBoss AS
Thank you.

However I've run into issues using the JMS 2 API.

1) The parameter-less createSession() throws the same exception.

2) In a Java EE transaction, sessionMode is ignored.   ----> I have tested this and it is not ignored and only works with SESSION_TRANSACTED. (createSession with One parameter)

3) Changing the sendMessage() method to use JMS 2 API with an injected JMSContext results in the same exception. The JMSContext gets injected but the createQueue() method is where the exception is thrown:

private void sendMessage()
  {
    System.out.println("Sending tibco message(s).");
    int i = 9;
    while(i>0){
      Queue testQ = context.createQueue("Q.ZA.ILSA.ESB.integration.test");
      context.createProducer().send(testQ, "Hello world!" + (int) (Math.random() * 100));
      i--;
    }
    System.out.println("Sent messages!");
  }

13:54:23,602 ERROR [stderr] (ServerService Thread Pool -- 65) java.lang.NullPointerException

13:54:23,602 ERROR [stderr] (ServerService Thread Pool -- 65)  at org.jboss.jca.core.tx.jbossts.XAResourceWrapperImpl.setTransactionTimeout(XAResourceWrapperImpl.java:204)

Justin Bertram

unread,
Feb 28, 2017, 11:02:16 AM2/28/17
to Generic JMS JCA Resource Adapter for JBoss AS
I already addressed this issue in my previous comment.  Did you not read through the Bugzilla reference I linked?  

In short, this is a known issue that you'll just need to work around by specifying the necessary sessionMode.  If you don't want to do that then you can revert the related commit (which I also linked in my previous comment), and build the RA yourself.  There's full instructions on building the RA in the project documentation.

Ahmed Theba

unread,
Mar 1, 2017, 8:21:04 AM3/1/17
to Generic JMS JCA Resource Adapter for JBoss AS
Yes, I understood that it is a known issue. However the issue is marked as "CLOSED WONTFIX".


Ok thanks... I think the previous commit should work for us as we only run XA transacted.

Reply all
Reply to author
Forward
0 new messages