9 Replies Latest reply on Sep 11, 2003 1:36 AM by Stephane Nicoll

    ConnectionFactory not bound (again)

    mattygiedt Newbie

      I'm starting the 3.2.1 server with run -c default.

      I've added to user-service.xml my own MBean which attempts to connect to a JMS Queue that is successfully created on startup. I get the 'javax.naming.NameNotFoundException: ConnectionFactory not bound' when trying to obtain the object bound to 'ConnectionFactory' from the JNDI.

      JMS is started cleanly otherwise. The variables passed into my MBean are all good. I (think) that I want to on the InvocationLayer as that is what sets up the java:ConnectionFactory in the JVMServerILService.

      Finally, I have purchased the comprehensive documentation, if please let me know where I can read about what I'm getting hung up on.

      Thanks in advance for any help.

      -Matt

      -------------------------- user-service.xml


      5150
      2048
      C:\\artifact\\data\\
      queue/listenerQueue
      ConnectionFactory
      jboss.mq:service=InvocationLayer

        • 1. Re: ConnectionFactory not bound (again)
          Stephane Nicoll Master

          Try to put the dependencies on the DestinationManagert

          jboss.mq:service=DestinationManager

          Also, post the code snippet that gets the factory

          • 2. Re: ConnectionFactory not bound (again)
            mattygiedt Newbie

            Here is the code calling the ctx lookup in ListenerQueueConnection.java:

            private void init( String connectionFactory, String queue )
            throws JMSException, NamingException
            {
            System.err.println("Looking up conn factory: " + connectionFactory );

            InitialContext ctx = new InitialContext();

            Object o = ctx.lookup( connectionFactory ); // line 31

            if( o != null )
            {
            System.err.println(" Conn Factory Object: " + o.getClass().getName() );
            }

            QueueConnectionFactory qcf = (QueueConnectionFactory)o;
            Queue q = (Queue)ctx.lookup( queue );

            qcon = qcf.createQueueConnection();
            session = qcon.createQueueSession( false,
            QueueSession.AUTO_ACKNOWLEDGE );
            sender = session.createSender( q );
            qcon.start();
            }

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

            Here is the exception(s):

            Cause: Incomplete Deployment listing:
            Packages waiting for a deployer:

            Incompletely deployed packages:

            MBeans waiting for classes:

            MBeans waiting for other MBeans:
            [ObjectName: user:service=ListenerService
            state: FAILED
            I Depend On: jboss.mq:service=DestinationManager

            Depends On Me: javax.naming.NameNotFoundException: ConnectionFactory not bound]

            09:49:53,741 ERROR [STDERR] Looking up conn factory: ConnectionFactory
            09:49:53,751 ERROR [ListenerService] Starting failed
            javax.naming.NameNotFoundException: ConnectionFactory not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
            at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at com.art.listener.ListenerQueueConnection.init(ListenerQueueConnection.java:31)
            .......

            Note that now both the ConnectionFactory and Queue are not in the JNDI tree when my MBean is dependent on DestinationManager, as the queue is loaded after my MBean tries to start. I think this is a dependency problem, but have no idea what to on.

            Thanks in advance,
            -Matt

            • 3. Re: ConnectionFactory not bound (again)
              Adrian Brock Master

              I would place a dependency on the OIL connection factory
              (the connection factory you are using) and the
              queue MBean.

              Regards,
              Adrian

              • 4. Re: ConnectionFactory not bound (again)
                Stephane Nicoll Master

                are u really sure that JMS starts fine on your JBoss?

                Try to find an item named RecursiveSearch in your /server/default/conf/jboss-service.xml and check if it set to true.

                If set to false it might cause the problem

                • 5. Re: ConnectionFactory not bound (again)
                  mattygiedt Newbie

                  boot.log says: (for the recursive search)

                  DEBUG [URLDeploymentScanner] Adding URL from spec: deploy/
                  11:05:04,307 DEBUG [URLDeploymentScanner] URL: file:/C:/art/jboss/server/listener/deploy/
                  11:05:04,307 DEBUG [URLDeploymentScanner] Added url: file:/C:/art/jboss/server/listener/deploy/
                  11:05:04,307 DEBUG [URLDeploymentScanner] URL list: [file:/C:/art/jboss/server/listener/deploy/]
                  11:05:04,307 DEBUG [ServiceConfigurator] RecursiveSearch set to true in jboss.deployment:type=DeploymentScanner,flavor=URL

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

                  Adrian, not sure how to on OIL or the Queue.

                  11:05:26,819 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
                  Cause: Incomplete Deployment listing:
                  Packages waiting for a deployer:

                  Incompletely deployed packages:

                  MBeans waiting for classes:

                  MBeans waiting for other MBeans:
                  [ObjectName: user:service=ListenerService
                  state: CONFIGURED
                  I Depend On: jboss.mq:service=DestinationManager
                  jboss.mq.destination:service=Queue
                  jboss.mq:service=InvocationLayer

                  Depends On Me: ]

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


                  5150
                  2048
                  C:\\artifact\\data\\
                  queue/listenerQueue
                  ConnectionFactory
                  jboss.mq:service=DestinationManager
                  jboss.mq.destination:service=Queue
                  jboss.mq:service=InvocationLayer



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

                  Thanks in advance,
                  -Matt

                  • 6. Re: ConnectionFactory not bound (again)
                    Adrian Brock Master

                    jboss.mq:service=InvocationLayer,type=OIL
                    jboss.mq.destination:service=Queue,name=listenerQueue

                    Regards,
                    Adrian

                    • 7. Re: ConnectionFactory not bound (again)
                      mattygiedt Newbie

                      Thanks everybody for your help. Changing the tag to Adrian's post did the trick.

                      Final aside:

                      I now recognize that I'm using the OIL Invocation Layer (thanks again Adrian) as I'm grabbing the 'ConnectionFactory' from the ctx. I think that I should be using the JVM IL per the documentation as my MBean is run inside the JBoss jvm.

                      So now my user-service.xml looks like:


                      5150
                      2048
                      C:\\artifact\\data\\
                      queue/listenerQueue
                      java:/ConnectionFactory
                      jboss.mq:service=DestinationManager
                      jboss.mq:service=InvocationLayer,type=JVM
                      jboss.mq.destination:service=Queue,name=listenerQueue


                      And everything works fine.

                      -Matt

                      • 8. Re: ConnectionFactory not bound (again)
                        vincentchun Newbie

                        Thanks for Dark_Lord

                        After I set this
                        True
                        , I solve the problem.

                        • 9. Re: ConnectionFactory not bound (again)
                          Stephane Nicoll Master

                          you're welcome :)