1 Reply Latest reply on Jan 23, 2004 11:49 AM by parveen

    Exception starting QueueConnection with JBoss 3.2.1

    wolfgangs Newbie

      Hi,

      please help - I try to establish a JMS point-to-point queue within my EJB application.

      Code is:

      static {
      try {
      ctx = new InitialContext();
      factory = (QueueConnectionFactory) ctx.lookup("java:/OSAppJmsQueueConnectionFactory");

      connection = factory.createQueueConnection();
      connection.start();

      try {
      queue = (Queue) ctx.lookup(QUEUE_NAME);
      } catch (NamingException ex) {
      ...
      }

      This static block is part of a simple Java class called 'Engine' accessed by a stateless session bean.
      Creation of queue, session, messages is done later in the code in a separate method.

      JBoss 3.2.1 starts without Errors/Warnings, but when I try to access the 'Engine' at runtime, I'll get the following error:

      ...
      10.07.2003 11:47:01 TRACE [net.kapsch.kcc.osapp.web.ClientServlet] none:CONNECT Connecting to OSApp
      10.07.2003 11:47:01 INFO [STDOUT] Loading Configuration
      10.07.2003 11:47:02 INFO [net.kapsch.kcc.osapp.fw.ejb.MasterBean] none:SR Processing Request
      10.07.2003 11:47:02 TRACE [net.kapsch.kcc.osapp.fw.ejb.MasterBean] none:TRACE <?xml version="1.0" encoding="UTF-8"?>
      <request request-id="193.81.24.70/da3a1e:f64b584475:-7fd8"
      service-id="net.kapsch.kcc.osapp.fw.svc.OSAppCommonService:reload"
      timestamp="2003-07-10T11:47:01,923" xid="none"/>

      10.07.2003 11:47:03 ERROR [net.kapsch.kcc.osapp.fw.Engine] none:COMMUNICATION_FAULT Exception in creating the queue connection
      java.lang.IllegalStateException: This method is not applicatable in JMS resource adapter
      at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.start(JmsSessionFactoryImpl.java:217)
      at net.kapsch.kcc.osapp.fw.Engine.(Engine.java:118)
      at net.kapsch.kcc.osapp.fw.ejb.MasterBean.execute(MasterBean.java:254)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:216)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
      at org.jboss.ejb.Container.invoke(Container.java:674)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:83)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      at $Proxy58.execute(Unknown Source)
      at net.kapsch.kcc.osapp.web.ClientServlet.process(ClientServlet.java:266)
      at net.kapsch.kcc.osapp.web.ClientServlet.doPost(ClientServlet.java:116)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
      at java.lang.Thread.run(Thread.java:534)

      Configuration is copied from JmsXA.

      Here is my osapp-jms-ds.xml:

      <connection-factories>

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


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


      <tx-connection-factory>
      <jndi-name>OSAppJmsQueueConnectionFactory</jndi-name>
      <xa-transaction/>
      <!-- <track-connection-by-tx>false</track-connection-by-tx> -->
      <adapter-display-name>JMS Adapter</adapter-display-name>
      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
      </tx-connection-factory>

      </connection-factories>

      I've no further configuration entries for this connection factory or the queues in ejb-jar.xml or elsewhere.

      I scanned the forum, but only found this very old posting: Closing a java:/JmsXA connection before exiting the transaction Posted: Aug 29, 2001 3:53 AM
      - the bug should be fixed by now ?!

      I think, there must be a very simple solution, maybe I missunderstood the configuration ?

      Anyony any idea ?
      Thanks in advance