5 Replies Latest reply on Mar 17, 2003 2:31 PM by slaboure

    Clustering Issue

    lc33

      Hi all,

      I've been working on a clustering project using JBoss 3.0.4 on RedHat 8.0 but haven't had much luck. Here's what have been set up:

      1. JBoss 3.0.4 server instances, using "-c all" config with default multicast setup, on two hosts, hostA and hostB. Farming is not turned on.

      2. Tomcat 4.1.12, which is not built-in with JBoss. Included jbossall-client.jar under $CATALINA_HOME/common/lib/. (Tomcat is loadbalanced with Apache 2.0 using JK2.)

      3. A simple client test app running on hostA. Its JNDI lookup portion is as follows:
      -----------
      Properties props = new Properties();
      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(Context.PROVIDER_URL, "");
      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      -----------

      The above setup works well only when the jboss instance on hostA, on which the client resides, is up. I tested multicast on the network using some test script from www.javagroups.com and it seems to be working. Tried also the TCPPING approach with no avail. Upgraded to the latest JBoss 3.0.6. Same problem.

      Appended are partial error messages when JBoss on hostA is down and hostB is up. Any advice would be greatly appreciated.

      Regards,
      LC

      -----------
      1. CASE 1 - props.put(Context.PROVIDER_URL, "")

      javax.naming.CommunicationException: Failed to connect to server

      127.0.0.1:1100 [Root exception is javax.naming.ServiceUnavailableException: Failed to

      connect to server 127.0.0.1:1100 [Root exception is java.net.ConnectException: Connection

      refused]]
      javax.naming.CommunicationException: Failed to connect to server 127.0.0.1:1100. Root

      exception is javax.naming.ServiceUnavailableException: Failed to connect to server

      127.0.0.1:1100. Root exception is java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:426)
      at java.net.Socket.connect(Socket.java:376)
      at java.net.Socket.(Socket.java:291)
      at java.net.Socket.(Socket.java:199)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:179)
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1026)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1134)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:470)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:463)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at test.web.servlet.HelloJndiServlet.doGet(Unknown Source)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at

      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j

      ava:247)
      at

      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at

      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at

      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:643)
      at

      org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at

      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:256)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:361)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:563)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:535)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:638)
      at

      org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
      at java.lang.Thread.run(Thread.java:536)

      -----------
      1. CASE 2 - props.put(Context.PROVIDER_URL, "hostB:1100")

      ENCOUNTERED EXCEPTION: javax.naming.CommunicationException [Root exception is

      java.rmi.RemoteException: Service unavailable.]
      javax.naming.CommunicationException. Root exception is java.rmi.RemoteException: Service

      unavailable.
      at

      org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:161)
      at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:199)
      at $Proxy0.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:484)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:463)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at test.web.servlet.HelloJndiServlet.doGet(Unknown Source)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at

      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j

      ava:247)
      at

      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at

      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at

      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:643)
      at

      org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at

      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at

      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar

      dPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:256)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:361)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:563)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:535)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:638)
      at

      org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
      at java.lang.Thread.run(Thread.java:536)

      -----------

        • 1. Re: Clustering Issue
          usiwill

          What IP address is your client trying to connect to for JNDI? If you aren't using localhost, you may need to add a line in /etc/hosts that maps your hostname to your systems IP address. I believe that I had a similar issue and this fixed the problem.

          /etc/hosts would look something like this

          127.0.0.1 localhost.localdomain localhost
          192.168.1.1 mycomputer

          -Will

          • 2. Re: Clustering Issue
            anfo

            I replied to you post but this forum seems buggy, if this post gets through with out the wierd auth error even though I am logged in...

            • 3. Re: Clustering Issue
              lc33

              Hmmmm, I saw 2 replies to my post on the list page but can't find any reply content on the message detail page ... Weird!

              • 4. Re: Clustering Issue
                lc33

                Ok, I see the replies now. And it's rewarding. Thank you all for responding to my post.

                Will, adding the IPs & hosts to /etc/hosts does it. I would've never looked in that direction since I'm using plain IP addresses in the clustering config setup. Thanks a bunch!!

                LC

                • 5. Re: Clustering Issue
                  slaboure

                  yes, that may seem counterintuitive but some parts of the code may ask the JVM for the hostname.

                  Cheers,


                  sacha