1 Reply Latest reply on May 29, 2006 5:19 PM by Carlos Lizarralde

    Exception stopping JmsXA

    Carlos Lizarralde Newbie

      I'm using Jboss 4.0.1sp1, jdk 1.4.2, Windows XP. And I have a ¿problem? with the JMS resource adapter.

      In short terms, I have a session bean that read messages from a JMS queue, process the data, make changes in an Oracle database and then
      other changes in an Sql Server database. And i need transaction across them.

      I have the datasources correctly configured as XA.

      In the past i was using the XAConnectionFactory as the QueueConnectionFactory to read the message from the JMS qeueu, but I notice that althought everything was working, I didn't have really transactional behavior.
      For example if jboss was killed after reading a message from the Jms queue but before processing it and storing some info in Oracle database, the message was lost.

      After reading some post in the forums,
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=52061

      and the Wiki page
      http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMQ

      I realize that I need to change the QueueconnectionFactory to java:/JmsXA

      Although things seemed to work, now I'm having an exception in the console, and I don't thinks is normal.
      This exception appears when I stop the QueueConnectionFactory


      17:32:09,704 INFO [STDOUT] javax.jms.IllegalStateException: This method is not applicatable in JMS resource adapter
      17:32:09,704 INFO [STDOUT] at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.stop(JmsSessionFactoryImpl.java:238)
      17:32:09,704 INFO [STDOUT] at com.np.iaso.integration.impl.JMSQueuePollStrategy.stop(JMSQueuePollStrategy.java:294)
      17:32:09,704 INFO [STDOUT] at $PollStrategy_10b537c203e.stop($PollStrategy_10b537c203e.java)
      17:32:09,704 INFO [STDOUT] at com.np.iaso.integration.PollServiceImpl.poll(PollServiceImpl.java:70)
      17:32:09,704 INFO [STDOUT] at $PollService_10b537c203b.poll($PollService_10b537c203b.java)
      17:32:09,720 INFO [STDOUT] at $PollService_10b537c203a.poll($PollService_10b537c203a.java)
      17:32:09,720 INFO [STDOUT] at com.np.iaso.ejb.PollingBean.poll(PollingBean.java:116)


      Is this exception normal?
      Why I'm getting this exception when using the JmsXA and not when using the XAConnectionFactoy (calling the stop method)?

      Thanks a lot in advance!!!

      Regards