4 Replies Latest reply on Nov 15, 2006 7:14 AM by loewe

    JMS JNDI Names

    loewe Newbie

      I ve written a simple Chat Programm, which uses the old JBossMQ JMS Provider.
      In this Programm i am using subcontexts to build up a hierarchical structure of Chatrooms.
      My old Service Descriptor looked like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE server PUBLIC "-//JBoss//DTD MBean Service 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-service_3_2.dtd">
      
      <server>
       <mbean code="org.jboss.mq.server.jmx.Topic"
       name="jboss.mq.destination:service=Topic,name=jmschat/room/Lounge">
       <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
       </mbean>
      </server>
      
      


      I ve realized that you developed a new "JBoss Messaging" and therefore i want to rewrite the Chat for the new Provider.
      I added the Classloader entry and changed the Class-Names of the Topic's and Queue's.

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE server PUBLIC "-//JBoss//DTD MBean Service 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-service_3_2.dtd">
      
      <server>
       <loader-repository>jboss.messaging:loader=ScopedLoaderRepository
       <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
       </loader-repository>
      
       <mbean code="org.jboss.jms.server.destination.Topic"
       name="jboss.messaging.destination:service=Topic,name=jmschat/room/Lounge"
       xmbean-dd="xmdesc/Topic-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <attribute name="SecurityConfig">
       <security>
       <role name="guest" read="true" write="true" create="true"/>
       </security>
       </attribute>
       </mbean>
      </server>
      
      


      But when i deploy the Service Descriptor, i get the following exception. :(

      17:42:49,765 ERROR [ExceptionUtil] Topic[null, name=jmschat/room/Lounge] startService
      javax.naming.NameNotFoundException: jmschat not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
       at org.jnp.server.NamingServer.rebind(NamingServer.java:165)
       at org.jnp.server.NamingServer.rebind(NamingServer.java:168)
       at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:510)
       at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:477)
       at org.jboss.jms.server.DestinationJNDIMapper.registerDestination(DestinationJNDIMapper.java:124)
       at org.jboss.jms.server.destination.DestinationServiceSupport.startService(DestinationServiceSupport.java:129)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
       at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      


      I am not sure if the problem is the subcontext but it seams like it is!

      You know a posible Solution or do i need to rewrite my Chat Programm?

      Ralph

        • 1. Re: JMS JNDI Names
          Tim Fox Master

          The name can't contain any "/" characters.

          If you want to place the destination somewhere other than the default in JNDI you can use the JNDIName attribute:

           <!-- This attribute is writable to allow configuring an arbitrary JNDI name in the topic's
           service deployment descriptor. Any attempt to change the attribute after initialization
           will be ignored.
           -->
           <attribute access="read-write" getMethod="getJNDIName" setMethod="setJNDIName">
           <description>The destination's JNDI name</description>
           <name>JNDIName</name>
           <type>java.lang.String</type>
           </attribute>
          
          




          • 2. Re: JMS JNDI Names
            mskonda Apprentice

            Sorry tim, could be a dumb question:

            Where does this attribute def goes? I tried in destination-service.xml, but seems not the right place?

            Thanks
            Madhu

            • 3. Re: JMS JNDI Names
              Tim Fox Master

              It goes in the mbean config for the destination

              • 4. Re: JMS JNDI Names
                loewe Newbie

                Thanks for the hint! It works!

                Here is my complete JBoss Messaging Destination Descriptor:

                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE server PUBLIC "-//JBoss//DTD MBean Service 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-service_3_2.dtd">
                
                <server>
                 <loader-repository>jboss.messaging:loader=ScopedLoaderRepository
                 <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
                 </loader-repository>
                
                 <mbean code="org.jboss.jms.server.destination.Topic"
                 name="jboss.messaging.destination:service=Topic,name=jmschat.room.Lounge"
                 xmbean-dd="xmdesc/Topic-xmbean.xml">
                 <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                 <attribute name="SecurityConfig">
                 <security>
                 <role name="guest" read="true" write="true" create="true"/>
                 </security>
                 </attribute>
                 <attribute name="JNDIName">topic/jmschat/room/Lounge</attribute>
                 </mbean>
                </server>
                


                Ralph