7 Replies Latest reply on Jun 3, 2011 1:57 AM by vdurbha

    Remote Access to JBoss 6.0.0 Inbuilt HornetQ

    vdurbha

      Hi,

       

      I'm using JBoss 6.0.0 and want to connect to the inbuilt HornetQ from JMS client programs which run on remote machines. I have already changed the hornetq-configuration.xml file inside JBoss to specify binding address instead of localhost on connectors and acceptors. But I was still unable to connect.

       

      Can someone help with the configuration?

        • 1. Re: Remote Access to JBoss 6.0.0 Inbuilt HornetQ
          clebert.suconic

          Why don't you look at the examples and documentation first?

          • 2. Re: Remote Access to JBoss 6.0.0 Inbuilt HornetQ
            vdurbha

            Hi Clebert,

             

            I've read all the documentation about connectors and acceptors in the user manual and understood that as long as the binding address is changed from localhost to a particular hostname or ipaddress, remote clients will be able to make a connection.

             

            After doing that, I still wasn't able to connect. So I was just wondering if any additional changes are needed in JBoss config files. I got this doubt because the embedded HornetQ server in JBoss probably doesn't have its own JNDI server, but uses the JNDI server of JBoss. I'm not sure if any changes are needed regarding the binding port of JBoss JNDI server. Just to let you know, my JBoss server is started with a binding address of 0.0.0.0. I'm not sure if that is being adopted by JBoss JNDI server.

             

            Please let me know if any of my assumptions are incorrect.

            • 3. Re: Remote Access to JBoss 6.0.0 Inbuilt HornetQ
              clebert.suconic

              HornetQ standalone has an embedded JNDI server.

               

               

              I'm not sure what's happening there. you need to provide more details about your error. Steps you are following... (something simple please).

               

              I can't guess what you are doing wrong. this is quite simple and basic. So, you are doing something wrong.

              • 4. Re: Remote Access to JBoss 6.0.0 Inbuilt HornetQ
                vdurbha

                I have machine A on which I'm running JBoss 6.0.0 server. I have created a queue on it and deployed an MDB.

                I have machine B on which I'm running a simple JMS Client program which is trying to put a message on that queue on MachineA.

                 

                I have modified <jboss_home>/server/default/deploy/hornetq/hornetq-configuration.xml and changed the binding address of netty connector and acceptor from localhost to the ip address of machine A.

                 

                When I run the client, it fails to connect. I'll upload the exact error once I reach work in a few minutes.

                 

                Please let me konw if I'm missing anything.

                 

                Appreciate all your help.

                • 5. Re: Remote Access to JBoss 6.0.0 Inbuilt HornetQ
                  clebert.suconic

                  You have to define the same IP/port on the connector. That's all

                  • 6. Re: Remote Access to JBoss 6.0.0 Inbuilt HornetQ
                    vdurbha

                    When I run the JMS Client, this is the error I see. Even though I changed the IP on the connector, I still see "localhost.localdomain" in the stack trace.

                     

                         [java]java.net.ConnectException: Connection refused]
                         [java]at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:841)
                         [java]at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
                         [java]at javax.naming.InitialContext.lookup(InitialContext.java:409)
                         [java]at com.cts.hornetq.examples.jms.JMSExample.main(Unknown Source)
                         [java]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         [java]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                         [java]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                         [java]at java.lang.reflect.Method.invoke(Method.java:616)
                         [java]at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
                         [java]at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
                         [java]at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
                         [java]at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
                         [java]at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
                         [java]at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
                         [java]at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
                         [java]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         [java]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                         [java]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                         [java]at java.lang.reflect.Method.invoke(Method.java:616)
                         [java]at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
                         [java]at org.apache.tools.ant.Task.perform(Task.java:348)
                         [java]at org.apache.tools.ant.Target.execute(Target.java:357)
                         [java]at org.apache.tools.ant.Target.performTasks(Target.java:385)
                         [java]at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
                         [java]at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
                         [java]at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
                         [java]at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
                         [java]at org.apache.tools.ant.Main.runBuild(Main.java:758)
                         [java]at org.apache.tools.ant.Main.startAnt(Main.java:217)
                         [java]at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
                         [java]at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

                         [java] Caused by: java.rmi.ConnectException: Connection refused to host: localhost.localdomain; nested exception is:

                         [java]java.net.ConnectException: Connection refused
                         [java]at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
                         [java]at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
                         [java]at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
                         [java]at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:128)
                         [java]at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
                         [java]at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
                         [java]... 30 more
                    • 7. Re: Remote Access to JBoss 6.0.0 Inbuilt HornetQ
                      vdurbha

                      Hi,

                       

                      I got this resolved. I was earlier starting the JBoss server as follows:

                       

                      ./run.sh -b 0.0.0.0

                       

                      Now I'm using the actual ip address of the machine as follows:

                       

                      ./run.sh -b 10.226.105.31

                       

                      I guess that made a difference to the RMI binding address. Hope this will be useful for others with similar problems.