9 Replies Latest reply on Jun 22, 2009 3:19 AM by jaikiran pai

    4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI names

    Richard Kennard Novice

      The JBoss Messaging guys (you have them to blame for this :) suggested I refer this issue to you.

      In JBoss 4.2.3.GA, I was able to declare my queues like this...

      <mbean code="org.jboss.mq.server.jmx.Queue"
       name="jboss.mq.destination:service=Queue,name=my-app/imports1">
       ...
      </mbean>


      ...but this gives an error in 5.1.0.GA that the namespace 'my-app' is not bound. The error is correct, it is not bound, but in 4.2.3.GA JBoss would automatically create it for me.

      In 5.1.0.GA, I have to do...

      <mbean code="org.jboss.jms.server.destination.QueueService"
      name="jboss.messaging.destination:service=Queue,name=my-app-imports1"
      ...
      </mbean>


      ...so therefore my-app-imports1 does not enjoy the same JNDI 'heirarchy' as my-app/imports1.

      Is this intentional to a new spec?

      Thanks in advance,

      Richard.

      P.S. The original forum thread is here: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4237550#4237550

        • 1. Re: 4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI name
          jaikiran pai Master

           

          18:31:23,437 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.J
          msActivationSpec@1030063(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@e0863a destination=que
          ue/avant-ss/imports1 destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=jav
          a:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=3 keepAlive=60000 useDLQ=true
          DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser
          =null DLQMaxResent=5)
          javax.naming.NameNotFoundException: avant-ss not bound
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
           at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
           at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
           at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
           at javax.naming.InitialContext.lookup(InitialContext.java:392)
           at org.jboss.util.naming.Util.lookup(Util.java:222)
           at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:464)
           at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:352)
           at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:729)
           at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
           at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
           at java.lang.Thread.run(Thread.java:619)
          18:31:23,437 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=avant-ss-app.ear,jar=avant-ss-ejb.
          jar,name=CalculationVariablesBean,service=EJB3


          Going by the exception stacktrace you posted, i guess its a dependency issue and not related to the the jndi naming. But i am surprised why it would work with just my-app-imports1.

          In your MDB, could try adding a dependency (either through jboss.xml or through annotation) to depend on the queue? See this for an example:

          http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/mdb_deployment_descriptor/META-INF/jboss.xml
          or
          http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/mdb/src/org/jboss/tutorial/mdb/bean/ExampleMDB.java

          • 2. Re: 4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI name
            Richard Kennard Novice

            jaikiran,

            Thank you for staying with me. Your patience is most appreciated.

            Unfortunately what you suggested did not work.

            Even if it had, I'm not sure it would have been a good idea because jboss.xml is app-specific whereas destinations-service.xml is 'JBoss wide': if I declare a heirarchical JNDI queue in my destinations-service.xml it shouldn't fail just because I don't also deploy an app that depends on it.

            I think the problem is more that JCA needs to auto-create the heirarchical name. JBoss 4.2.3.GA seemed to do this.

            Regards,

            Richard.

            • 3. Re: 4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI name
              jaikiran pai Master

               

              "kennardconsulting" wrote:
              if I declare a heirarchical JNDI queue in my destinations-service.xml it shouldn't fail just because I don't also deploy an app that depends on it.


              You mean, if you create a queue with that "hierarchical" JNDI name and don't deploy any applications which use this queue, you still see the failure? Can you post the entire exception stacktrace in such a scenario? I guess it should not be a NameNotFoundException.



              • 4. Re: 4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI name
                jaikiran pai Master

                And please also post the exact queue configuration file contents. The first post contains a combination of JBoss MQ and JBoss Messaging queue configurations. Just want to make sure we are discussing about the correct file.

                • 5. Re: 4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI name
                  jaikiran pai Master

                  I just tried this with the default DLQ configuration that comes with JBoss:

                  <mbean code="org.jboss.jms.server.destination.QueueService"
                   name="jboss.messaging.destination:service=Queue,name=DLQ"
                   xmbean-dd="xmdesc/Queue-xmbean.xml">
                   <attribute name="JNDIName">jaikiran/DLQ</attribute>
                   <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                   <depends>jboss.messaging:service=PostOffice</depends>
                   </mbean>


                  And it worked fine for me. The server started up with this log:

                  13:21:49,353 INFO [QueueService] Queue[jaikiran/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000


                  • 6. Re: 4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI name
                    Vicky Kak Master

                     

                    "kennardconsulting" wrote:
                    The JBoss Messaging guys (you have them to blame for this :) suggested I refer this issue to you.


                    Let us get back to the same forum entry and pick some info from there, I see

                    ActivationSpec@1030063(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@e0863a destination=que
                    ue/avant-ss/imports1


                    I don't see any Queue bound to this name queue/avant-ss/imports1.
                    Can you share the MDB configurations?

                    • 7. Re: 4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI name
                      Vicky Kak Master

                      Also did you confirm from the JNDI view if the Queues are bound to JNDI properly, I don't think so.

                      • 8. Re: 4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI name
                        Richard Kennard Novice

                        jaikiran,

                        Your example uses the attribute JNDIname, but the queue name is still just DLQ...

                        <mbean code="org.jboss.jms.server.destination.QueueService"
                        name="jboss.messaging.destination:service=Queue,name=DLQ">


                        ...it is the queue name I wanted to be heirarchical. I thought by putting it under a heirarchy with the app name I could avoid naming conflicts in future? I am probably mistaken, however this worked in JBoss 4.2.3.

                        vickyk,

                        I can confirm the queues are bound correctly as long as I don't use a forward slash in the name.

                        Regards,

                        Richard.

                        • 9. Re: 4.2.3.GA to 5.1.0.GA regression - heirarchical JNDI name
                          jaikiran pai Master

                           

                          "kennardconsulting" wrote:

                          Your example uses the attribute JNDIname, but the queue name is still just DLQ...

                          <mbean code="org.jboss.jms.server.destination.QueueService"
                          name="jboss.messaging.destination:service=Queue,name=DLQ">


                          ...it is the queue name I wanted to be heirarchical. I thought by putting it under a heirarchy with the app name I could avoid naming conflicts in future? I am probably mistaken, however this worked in JBoss 4.2.3.


                          Ah, i see what you are saying, now :) And i could reproduce it too with the default DLQ:

                          <mbean code="org.jboss.jms.server.destination.QueueService"
                           name="jboss.messaging.destination:service=Queue,name=jaikiran/DLQ"
                           xmbean-dd="xmdesc/Queue-xmbean.xml">
                           <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                           <depends>jboss.messaging:service=PostOffice</depends>
                           </mbean>

                          This one fails to deploy:

                          12:45:07,184 ERROR [ExceptionUtil] Queue[/queue/jaikiran/DLQ, name=jaikiran/DLQ] startService
                          javax.naming.NameNotFoundException: jaikiran not bound
                           at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                           at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                           at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
                           at org.jnp.server.NamingServer.rebind(NamingServer.java:244)
                           at org.jnp.server.NamingServer.rebind(NamingServer.java:247)
                           at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:575)
                           at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:540)
                           at org.jboss.jms.server.DestinationJNDIMapper.registerDestination(DestinationJNDIMapper.java:142)
                           at org.jboss.jms.server.destination.QueueService.startService(QueueService.java:150)
                          


                          Let's get back to your original post in the JBoss Messaging forum to discuss this, since this now looks like a bug in JBoss Messaging or an unsupported feature.