4 Replies Latest reply on Feb 8, 2006 4:00 AM by lapoutre

    how to register a MBean using a Queue

    lapoutre

      let's go :

      I made a MBean that listen to a queue.

      but if the service is deployed and that I restart the server,
      the service can't be loaded because of the following error :

      javax.naming.NameNotFoundException: ConnectionFactory not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:281)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
       at javax.naming.InitialContext.lookup(InitialContext.java:347)
      


      what is the depencies for this error.

      it is provocated by the follwing code :

      InitialContext iniCtx = new InitialContext();
      Object tmp = iniCtx.lookup("ConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection();
      conn.setExceptionListener(this);
      session = conn.createQueueSession(false,
      QueueSession.AUTO_ACKNOWLEDGE);
      conn.start();
      ...
      


      thanks

        • 1. Re: how to register a MBean using a Queue
          lapoutre

          re,
          I tried the following dependencies each alone, and all together

           <depends optional-attribute-name="Invoker">jboss.mq:service=Invoker</depends>
           <depends>jboss.mq:alias=UIL2ConnectionFactory,service=InvocationLayer,type=UIL2</depends>
           <depends>jboss.mq:service=InvocationLayer,type=JVM</depends>


          but it doesn't work

          • 2. Re: how to register a MBean using a Queue

            it may be a bit late... the only service your mbean should depend on is the queue you are connecting to (queues are also defined as mbeans), this should do.

            regards,
            martin

            • 3. Re: how to register a MBean using a Queue
              mawione

              Did you find a solution to your problem?
              I'm having same problem.

              Thanks!

              Magnus

              • 4. Re: how to register a MBean using a Queue
                lapoutre

                in fact I'm coding it a second time.

                The thing, like wzzzrd said, is that You have to be independent of elements, as much as you can.

                The MBean is loaded but may be not connected at the JMS queue.
                In order to perfom that, I'm coding a retrying system.

                This system is usefull when you start jboss with your service.
                If it's hot plugged, the queue is already available and the MBean can connect it without any problem.