0 Replies Latest reply on Jun 23, 2004 7:49 AM by softwerc

    JMSException: invalid transaction id....

    softwerc Newbie

      I am trying to send message using JMS services but got following exception:
      -------------------------------------------------------------------------------------
      16:41:54,613 ERROR [STDERR] javax.jms.JMSException: Invalid transaction id.
      16:41:54,613 ERROR [STDERR] at org.jboss.mq.SpyXAResourceManager.addMessage(SpyXAResourceMa
      nager.java:93)
      16:41:54,613 ERROR [STDERR] at org.jboss.mq.SpySession.sendMessage(SpySession.java:651)
      16:41:54,623 ERROR [STDERR] at org.jboss.mq.SpyQueueSender.internalSend(SpyQueueSender.java
      :118)
      16:41:54,623 ERROR [STDERR] at org.jboss.mq.SpyQueueSender.send(SpyQueueSender.java:76)
      16:41:54,623 ERROR [STDERR] at com.softwerc.search.SearchBean.addMessagetoQueue(SearchBean.
      java:177)
      16:41:54,623 ERROR [STDERR] at com.softwerc.search.SearchBean.search(SearchBean.java:114)
      16:41:54,623 ERROR [STDERR] at org.apache.jsp.Search$jsp._jspService(Search$jsp.java:83)
      16:41:54,623 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.ja
      va:107)
      16:41:54,623 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

      16:41:54,623 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet$JspServletWrapper.servi
      ce(JspServlet.java:201)
      16:41:54,623 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServl
      et.java:381)
      16:41:54,623 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java
      :473)
      16:41:54,623 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

      16:41:54,623 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder
      .java:360)
      16:41:54,623 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(Web
      ApplicationHandler.java:280)
      16:41:54,623 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl
      er.java:553)
      16:41:54,623 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1717)
      16:41:54,623 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebAp
      plicationContext.java:549)
      16:41:54,623 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1667)
      16:41:54,623 ERROR [STDERR] at org.mortbay.http.HttpServer.service(HttpServer.java:862)
      16:41:54,623 ERROR [STDERR] at org.jboss.jetty.Jetty.service(Jetty.java:497)
      16:41:54,623 ERROR [STDERR] at org.mortbay.http.HttpConnection.service(HttpConnection.java:
      759)
      16:41:54,623 ERROR [STDERR] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.ja
      va:923)
      16:41:54,623 ERROR [STDERR] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:7
      76)
      16:41:54,623 ERROR [STDERR] at org.mortbay.http.SocketListener.handleConnection(SocketListe
      ner.java:202)
      16:41:54,623 ERROR [STDERR] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:2
      89)
      16:41:54,623 ERROR [STDERR] at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:4
      55)
      -------------------------------------------------------------------------------------

      I have following configurations for connection factory in jms-services.xml

      -------------------jms-services.xml--------------------------------------------

      <!--make the rar deploy!-->
      jboss.jca:service=RARDeployer

      <depends optional-attribute-name="ManagedConnectionFactoryName">

      <!--hack till better deployment system-->
      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JMS Adapter

      <!--real attributes-->


      <config-property>
      <config-property-name>SessionDefaultType</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>javax.jms.Topic</config-property-value>
      </config-property>


      jms/SearchQCFS



      <depends optional-attribute-name="ManagedConnectionPool">

      0
      50
      5000
      15
      <!--criteria indicates if Subject (from security domain) or app supplied
      parameters (such as from getConnection(user, pw)) are used to distinguish
      connections in the pool. Choices are
      ByContainerAndApplication (use both),
      ByContainer (use Subject),
      ByApplication (use app supplied params only),
      ByNothing (all connections are equivalent, usually if adapter supports
      reauthentication)-->
      ByContainerAndApplication


      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
      JmsXARealm

      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager

      java:/TransactionManager

      --------------------------------------------------------------------------------

      and for Queue in jbossmq-destinations-service.xml

      --------------------------------------------------------------------------------

      <depends optional-attribute-name="DestinationManager"> jboss.mq:service=DestinationManager


      --------------------------------------------------------------------------------
      and I am trying to send message as:
      ----------------------------------------------------------------------------
      ctxLookup = new InitialContext();
      qcfSearch = (QueueConnectionFactory) ctxLookup.lookup(
      strQueueConFactory);
      queConSearch = qcfSearch.createQueueConnection();
      System.out.println("Queue Connection created");

      ctxLookup = new InitialContext();
      queSearch = (Queue) ctxLookup.lookup(strSearchQueue);

      qsJms = queConSearch.createQueueSession(false,
      Session.AUTO_ACKNOWLEDGE);
      qsndJms = qsJms.createSender(queSearch);

      objmJms = qsJms.createObjectMessage();

      objmJms.setObject(objSearchMessage);

      qsndJms.send(objmJms, DeliveryMode.PERSISTENT, 5, 0);
      ----------------------------------------------------------------------------

      How to solve this problem, I am new to JBOSS