6 Replies Latest reply on Jun 19, 2008 11:06 AM by kconner

    Bind JBoss ESB to different IP -> javax.naming.Communication

    macross27

      Hi,

      I gave JBossESB 4.2.1GA a try today. I like to bind it to an external IP so I used "run.bat -b ". However the ESB didn't start correctly as it still tries to connect to localhost. I got tons of exceptions releated to JNDI I guess in different services (e.g. JBoss Messaging):

      2007-11-06 14:25:14,669 DEBUG [org.jnp.interfaces.NamingContext] Failed to connect to localhost:1099
      javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
       at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1387)
       at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:484)
       at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:477)
       at javax.naming.InitialContext.rebind(InitialContext.java:408)
       at org.apache.juddi.registry.rmi.JNDIRegistration.register(JNDIRegistration.java:95)
       at org.jboss.internal.soa.esb.dependencies.JuddiRMIService.startService(JuddiRMIService.java:149)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      ...
      


      This left the ESB unusable.

      In a second attempt I tried to use "-b 0.0.0.0" to bind the ESB to all IPs. This worked. However, now I got problems with my service consumer which tries to communicate with the ESB via a JMS queue. It couldn't communicate with the queue as RMI tried to use the windows hostname which can't be resolved:

      Exception: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: Saturn; nested exception is:
       java.net.UnknownHostException: Saturn]
      


      Any ideas on that? How can I bind JBossESB correctly to a different IP than localhost correctly?

      Thanks in advance.

      cu
      Sebastian


        • 1. Re: Bind JBoss ESB to different IP -> javax.naming.Communica
          kurtstam

          In most of the config files the defaults are to use 'localhost'. If you want to use the binding parameters you need to make sure it parameterize those settings. Use parameters like

          ${localhost}
          


          Hope that helps,

          --Kurt

          • 2. Re: Bind JBoss ESB to different IP -> javax.naming.Communica
            kconner

            Another solution would be to look at the service binding manager, supported since 4.2.1GA.

            This should allow you to modify the binding addresses for the core ESB services.

            • 3. Re: Bind JBoss ESB to different IP -> javax.naming.Communica
              macross27

              Hi,

              thanks for your help. It worked.

              I replaced localhost by the desired IP. I did this in two files:

              jbossesb-server-4.2.1GA\server\default\deploy\jbossesb.sar\jbossesb-properties.xml
              jbossesb-server-4.2.1GA\server\default\deploy\jbossesb.sar\esb.juddi.xml
              


              However, simply replacing localhost with the variable ${localhost} didn't work. Apparently it wasn't substituted with the IP from the -b parameter.

              The service binding manager seems more elegant, but I haven't located the documentation yet. Any input on that?

              Thanks!

              -- Sebastian

              • 4. Re: Bind JBoss ESB to different IP -> javax.naming.Communica
                kconner

                Hiya Sebastian.

                The ServiceBindingManager is enabled through the conf/jboss-service.xml file and takes the configuration from docs/examples/binding-manager/sample-bindings.xml. You specify the name of the binding set as an attribute of the MBean.

                The bindings file contains four service binding sets, each specifying a different range of port settings. If you choose ports-default then you will have the same port range as now but it will also honour variable substitution for -b.

                You should know that the ServiceBindingManager overrides parts of the configuration specified in the ESB configuration files but, at present, these are restricted to host/IP settings. You can also use it to override other settings should you wish.

                • 5. Re: Bind JBoss ESB to different IP -> javax.naming.Communica
                  riniskn

                  Hi there

                  I am also facing the same exception but when i change the files specified in the previous post i am facing the following exception while starting the server.

                  [JmsConnectionPool] Received NamingException, refreshing context.
                  [MessageAwareListener] Error processing courier, backing off for 1000 milliseconds
                  [JmsConnectionPool] Received NamingException, refreshing context.
                  [MessageAwareListener] Error processing courier, backing off for 2000 milliseconds
                  [JmsConnectionPool] Received NamingException, refreshing context.
                  [MessageAwareListener] Error processing courier, backing off for 4000 milliseconds
                  [JmsConnectionPool] Received NamingException, refreshing context.
                  [MessageAwareListener] Error processing courier, backing off for 8000 milliseconds
                  [JmsConnectionPool] Received NamingException, refreshing context.
                  [MessageAwareListener] Error processing courier, backing off for 16000 milliseconds
                  [JmsConnectionPool] Received NamingException, refreshing context.

                  It would be great if someone can look in to the problem.

                  thanks
                  Rinish

                  • 6. Re: Bind JBoss ESB to different IP -> javax.naming.Communica
                    kconner

                    You need to give us more information. Which version of ESB, what exception is in the logs etc

                    My first (wild) guess would be that something is hardcoding the JNDI parameters instead of using defaults/properties.