5 Replies Latest reply on Jun 22, 2012 6:29 AM by chithu21

    Unable to find out Jndi port number?

    sampathonline

      I am using jboss 5.1.0. I have created a JMS queue on server. I have written a standalone java client program to list all the queues on the server.

      In doing so, i need the jndi port number to do a intial context lookup. But I do not know the jndi port number. I am aware of the configuration settings(default, port-01, port-02) used in the file: server/default/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml. But the lookup is failing when i specify the jndi port number configured in bindings-jboss-beans.xml. My question now is "Is there a way to find out jndi port number from jboss admin-console,jmx-console or server.log?

        • 1. Re: Unable to find out Jndi port number?
          bluesockets

          Ususally out of the box it's port 1099. In server.log if you look for 1099 or whatever port the jnp server is supposed to bind to you should see the address/location. Can you post the entire stacktrace for the error it throws at you? Off the top of my head it could be a binding problem - if you bind jboss to a particular domain, it'll generally only listen for that address. If it binds to 127.0.0.1, I think it'll bind to all addresses.

          • 2. Re: Unable to find out Jndi port number?
            sampathonline

            1099 didnt work. My machine has several jboss instances. My domain server starts like this:

            run -Djboss.service.binding.set=ports-01.

            And the configuration for port-01 in bindings-jboss-beans.xml is defined as follows:

             

            <!-- The ports-01 bindings are obtained by taking the base bindings and adding 100 to each port value -->
               <bean name="Ports01Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
                  <constructor>
                     <!--  The name of the set -->
                     <parameter>ports-01</parameter>
                     <!-- Default host name -->
                     <parameter>${jboss.bind.address}</parameter>
                     <!-- The port offset -->
                     <parameter>1716</parameter>
                     <!-- Set of bindings to which the "offset by X" approach can't be applied -->

                     <parameter><null/></parameter>
                  </constructor>
               </bean>

             

            Since the offset is changed to 1716, I thought the jndi port is 1099+1716=2815, but when I do the context lookup for 2815, it fails

            • 3. Re: Unable to find out Jndi port number?
              bluesockets

              If you go to jmx-console for the jboss instance you're running (using the correct ports offset by your bindings), the click on

               

              1) the link "jboss" on the left hand side

                  http://localhost:8080/jmx-console/HtmlAdaptor?action=displayMBeans&filter=jboss

               

              2) then the link "service=Naming" on the right side of the page

                  http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DNaming

               

              It'll take you to the naming server configurations. Scroll down to the row named "Port" and you'll see "The listening port for the bootstrap JNP service. Set this to -1 to run the NamingService without the JNP invoker listening port." That row will tell you what port jnp is listening to.

              • 4. Re: Unable to find out Jndi port number?
                sampathonline

                Thanks antonio, I could figure out the problem....

                • 5. Re: Unable to find out Jndi port number?
                  chithu21

                  @ sampath subramaniam

                  Can you please tell how did u resolve the problem?