1 2 Previous Next 19 Replies Latest reply on Jun 24, 2009 7:42 PM by kennardconsulting

    Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not suppo

    kennardconsulting

      Hi all,

      In JBoss 4.2.3, I used to be able to do...

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


      ...and it worked great, but in JBoss 5.1.0.GA, I'm being told 'app' is not bound. I can get it working if I do...

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


      ...so is doing app/imports, as opposed to app-imports, not supported? I liked being able to give my queues a hierarchy.

      Regards,

      Richard.

        • 1. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
          gaohoward

          you probably need to specify the JNDIName attribute inside the mbean.

          • 2. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
            kennardconsulting

            gaohoward,

            Thank you for your quick reply.

            Unfortunately using JNDIName gives the same error ('app' not bound). It's probably fair to say that app isn't bound, but I was kind of hoping JBoss Messaging would create it automatically (like JBoss MQ did).

            Regards,

            Richard.

            • 3. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
              jaikiran

              Can you please post the entire configuration file which gives this error and also the entire exception stacktrace?

              • 4. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                kennardconsulting

                destinations-service.xml:

                <?xml version="1.0" encoding="UTF-8"?>
                
                <!--
                 Messaging Destinations deployment descriptor.
                
                 $Id: destinations-service.xml 85945 2009-03-16 19:45:12Z dimitris@jboss.org $
                 -->
                
                <server>
                
                 <!--
                 The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
                 -->
                
                 <mbean code="org.jboss.jms.server.destination.QueueService"
                 name="jboss.messaging.destination:service=Queue,name=DLQ"
                 xmbean-dd="xmdesc/Queue-xmbean.xml">
                 <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                 <depends>jboss.messaging:service=PostOffice</depends>
                 </mbean>
                
                 <!--
                 The Default Expiry Queue.
                 -->
                
                 <mbean code="org.jboss.jms.server.destination.QueueService"
                 name="jboss.messaging.destination:service=Queue,name=ExpiryQueue"
                 xmbean-dd="xmdesc/Queue-xmbean.xml">
                 <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                 <depends>jboss.messaging:service=PostOffice</depends>
                 </mbean>
                
                 <mbean code="org.jboss.jms.server.destination.QueueService"
                 name="jboss.messaging.destination:service=Queue,name=emails"
                 xmbean-dd="xmdesc/Queue-xmbean.xml">
                 <attribute name="JNDIName">avant-ss/emails</attribute>
                 <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                 <depends>jboss.messaging:service=PostOffice</depends>
                 </mbean>
                
                 <mbean code="org.jboss.jms.server.destination.QueueService"
                 name="jboss.messaging.destination:service=Queue,name=imports1"
                 xmbean-dd="xmdesc/Queue-xmbean.xml">
                 <attribute name="JNDIName">avant-ss/imports1</attribute>
                 <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                 <depends>jboss.messaging:service=PostOffice</depends>
                 </mbean>
                
                 <mbean code="org.jboss.jms.server.destination.QueueService"
                 name="jboss.messaging.destination:service=Queue,name=imports2"
                 xmbean-dd="xmdesc/Queue-xmbean.xml">
                 <attribute name="JNDIName">avant-ss/imports2</attribute>
                 <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                 <depends>jboss.messaging:service=PostOffice</depends>
                 </mbean>
                
                 <mbean code="org.jboss.jms.server.destination.QueueService"
                 name="jboss.messaging.destination:service=Queue,name=reports1"
                 xmbean-dd="xmdesc/Queue-xmbean.xml">
                 <attribute name="JNDIName">avant-ss/reports1</attribute>
                 <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                 <depends>jboss.messaging:service=PostOffice</depends>
                 </mbean>
                
                 <mbean code="org.jboss.jms.server.destination.QueueService"
                 name="jboss.messaging.destination:service=Queue,name=reports2"
                 xmbean-dd="xmdesc/Queue-xmbean.xml">
                 <attribute name="JNDIName">avant-ss/reports2</attribute>
                 <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                 <depends>jboss.messaging:service=PostOffice</depends>
                 </mbean>
                </server>


                Stack trace (for one of the queues):

                18:31:23,437 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=avant-ss-app.ear,jar=avant-ss-ejb.jar,name=ReportBean,service=EJB3
                18:31:23,437 INFO [EJBContainer] STARTED EJB: com.avant.ss.ejb.session.report.ReportBean ejbName: ReportBean
                18:31:23,437 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
                
                
                18:31:23,437 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1030063(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@e0863a destination=queue/avant-ss/imports1 destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/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


                • 5. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                  timfox

                  The stacktrace shows the exception is thrown from the JCA adapter, not from JBoss Messaging.

                  The generic JCA adapter is part of the application server project, it's not handled by the JBoss Messaging team.

                  Your best bet would be to post in the JCA users forum.

                  • 6. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                    kennardconsulting

                    Thanks Tim.

                    I have jumped this discussion across to: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238065#4238065

                    Regards,

                    Richard.

                    • 7. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                      jaikiran

                      After some discussion about this, with Richard, in the JCA forum this now looks like either a bug or an unsupported feature in JBoss Messaging http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238959#4238959

                      • 8. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                        timfox

                        Can you explain why you think this is a bug in JBM 1.x, I don't follow your reasoning here...

                        • 9. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                          jaikiran

                          When the MBean name contains a "hierarchy" and the destination configuration does not contain a JNDIName attribute, like this:

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

                          (note the use of name=jaikiran/DLQ)

                          org.jboss.jms.server.DestinationJNDIMapper while registering the destination, will internally try to register it at queue/jaikiran/DLQ:

                          12:45:07,184 ERROR [ExceptionUtil] Queue[/queue/jaikiran/DLQ, name=jaikiran/DLQ]
                          ...
                           at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:540)
                           at org.jboss.jms.server.DestinationJNDIMapper.registerDestination(DestinationJNDIMapper.java
                          :142)
                          

                          It considers the jaikiran/DLQ as one continuous name. But when a / is used for a name being bound to JNDI, the name gets parsed into sub-context. So the DestinationJNDIMapper is trying to bind it as follows:

                          queue
                           |
                           |--- jaikiran
                           |
                           |--- DLQ

                          But since the jaikiran "sub-context" is not created, the JNDI bind fails.

                          P.S: I am not claiming its a bug. It might even be an unsupported feature.


                          • 10. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                            timfox

                            In JBM 1.x, if you want to do this kind of thing you need to use JNDIName as Howard mentioned at the beginning of this thread.

                            • 11. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                              timfox

                              You could add a feature request JIRA if you like, if you want JBM 1.x to also support sub contexts on the name too.

                              • 12. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                                kennardconsulting

                                Tim,

                                I'm happy to add a feature request if this is outside spec.

                                Before I do, can I ask you to double check the spec because this did work in JBoss 4.2.3.GA and JBoss MQ?

                                Regards,

                                Richard.

                                P.S. Using JNDIName doesn't really work, because the queue name itself is not heirachical, so you can still get name clashes.

                                • 13. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                                  gaohoward

                                  Hi, to work around, you can use JNDIName and the queue name at the same time. The fact is if you use JNDIName, the queue name won't be used in JNDI binding anymore, so you can safely specify a hierarchical name.

                                  • 14. Re: Migrating 4.2.3.GA to 5.1.0.GA - queue hierarchies not s
                                    kennardconsulting

                                    gaohoward,

                                    Thanks for the tip. Is there no internal JBoss Messaging requirement that queue names (not JNDINames) be unique?

                                    For example, can I do...

                                    <mbean ... name=emails>
                                     <attribute name="JNDIName">app1/emails</attribute>
                                    </mbean>
                                    
                                    <mbean ... name=emails>
                                     <attribute name="JNDIName">app2/emails</attribute>
                                    </mbean>


                                    Note both queues are here named 'emails'. Only their JNDINames differ.

                                    Thanks,

                                    Richard.

                                    1 2 Previous Next