3 Replies Latest reply on Jun 24, 2004 3:59 PM by Elias Ross

    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--------------------------------------------
      <mbean code="org.jboss.resource.connectionmanager.XATxConnectionManager" name="jboss.jca:service=XaTxCM,name=SearchQCFS">
       <!--make the rar deploy!-->
       <depends>jboss.jca:service=RARDeployer</depends>
      
       <depends optional-attribute-name="ManagedConnectionFactoryName">
       <mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=XaTxDS,name=SearchQCFS">
       <!--hack till better deployment system-->
       <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JMS Adapter</depends>
      
       <!--real attributes-->
       <attribute name="ManagedConnectionFactoryProperties">
       <properties>
       <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>
       </properties>
       </attribute>
       <attribute name="JndiName">jms/SearchQCFS</attribute>
       </mbean>
       </depends>
      
       <depends optional-attribute-name="ManagedConnectionPool">
       <mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=XaTxPool,name=SearchQCFS">
       <attribute name="MinSize">0</attribute>
       <attribute name="MaxSize">50</attribute>
       <attribute name="BlockingTimeoutMillis">5000</attribute>
       <attribute name="IdleTimeoutMinutes">15</attribute>
       <!--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)-->
       <attribute name="Criteria">ByContainerAndApplication</attribute>
       </mbean>
       </depends>
       <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>
       <attribute name="SecurityDomainJndiName">JmsXARealm</attribute>
      
       <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
      
       <attribute name="TransactionManager">java:/TransactionManager</attribute>
       </mbean>


      and for Queue in jbossmq-destinations-service.xml


      <mbean code="org.jboss.mq.server.jmx.Queue"
       name="jboss.mq.destination:service=Queue,name=jms/SearchQueue">
       <depends optional-attribute-name="DestinationManager"> jboss.mq:service=DestinationManager</depends>
       </mbean>


      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