2 Replies Latest reply on May 30, 2003 8:39 AM by paultaylor

    Accesing JMSConnectionFactory

    paultaylor Newbie

      The class tries to get a TopicConnectionFactory as follows
      InitialContext ctx = new InitialContext();
      tConFactory = (TopicConnectionFactory)ctx.lookup("java:/ConnectionFactory));

      but jndi complains 15:54:47,898 ERROR [STDERR] javax.naming.NameNotFoundException: ConnectionFactory not bound
      15:54:47,898 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      15:54:47,898 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      15:54:47,898 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      15:54:47,898 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
      15:54:47,898 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
      15:54:47,898 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
      15:54:47,898 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:347)
      15:54:47,898 ERROR [STDERR] at com.vwssys.drive.ejb.notification.classes.TopicManager.init(TopicManager.java:60)

      The JBOSSMQService starts ok, Ihave set recursive to true but to no effect.

      Ive hit a deadend with this, can somebody help ?

        • 1. Re: Accesing JMSConnectionFactory
          helgi Newbie

          I had a similar problem with a QueueConnectionFactory

          I think the real problem lies in the deployment-descrs.

          I solved the problem by resolving java:comp/env/jms/QueueFactory

          In my ejb-jar i have:

          <resource-ref >
          <res-ref-name>jms/QueueFactory</res-ref-name>
          <res-type>javax.jms.QueueConnectionFactory</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>


          and in my jboss.xml i have:


          <resource-ref>
          <res-ref-name>jms/QueueFactory</res-ref-name>
          <jndi-name>java:/JmsXA</jndi-name>
          </resource-ref>


          • 2. Re: Accesing JMSConnectionFactory
            paultaylor Newbie

            Thanks for your reply however I forgot to mention Im running on JBOSS 3.2.1 I think your example refers to 3.0.4.

            The class trying to get a ConnectionFactory is not itself an ejb just a standard java class invoked by the scheduler.

            I have added two depends elements to stop it from starting until my application ear has deployed jboss.j2ee:module=ejbEventService.jar,service=EjbModule
            jboss.mq:service=InvocationLayer,type=JVM
            but it doesn't actually start at all. i have to go into the JMX Management Component and invoke Start on the
            Scheduler Service.

            From the info you gave us I tried looking up java:/JmsXA instead this got me slightly further giving the following stacktrace:
            javax.resource.spi.CommException: javax.naming.NameNotFoundException: XAConnectionFactory not bound
            at org.jboss.resource.adapter.jms.JmsManagedConnection.setup(JmsManagedConnection.java:632)
            at org.jboss.resource.adapter.jms.JmsManagedConnection.(JmsManagedConnection.java:167)
            at org.jboss.resource.adapter.jms.JmsManagedConnectionFactory.createManagedConnection(JmsManagedConnectionFactor
            y.java:96)
            at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnection(InternalManagedConnection
            Pool.java:352)
            at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPoo
            l.java:151)
            at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnection
            Pool.java:429)
            at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:
            413)
            at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:331)
            at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:48
            8)
            at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseCon
            nectionManager2.java:798)
            at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createTopicSession(JmsSessionFactoryImpl.java:159)
            at com.vwssys.drive.ejb.notification.classes.TopicManager.init(TopicManager.java:62)