10 Replies Latest reply on Dec 31, 2003 10:14 AM by sudsy

    jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't wor

    jflinchbaugh

      i start jboss 3.2.[23] with run.sh --host=127.0.0.1, but when i try to shutdown with ./shutdown.sh --server=127.0.0.1 --shutdown, something still tries to connect to the outside interface but can't, so it fails.

      here's my exception from running shutdown.sh:
      Exception in thread "main" javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 68.82.221.209; nested exception is:
      java.net.ConnectException: Connection refused]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at org.jboss.Shutdown.main(Shutdown.java:182)
      Caused by: java.rmi.ConnectException: Connection refused to host: 68.82.221.209; nested exception is:
      java.net.ConnectException: Connection refused
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
      ... 3 more
      Caused by: 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:452)
      at java.net.Socket.connect(Socket.java:402)
      at java.net.Socket.(Socket.java:309)
      at java.net.Socket.(Socket.java:124)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
      ... 8 more

        • 1. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
          sudsy

           

          "jflinchbaugh" wrote:
          i start jboss 3.2.[23] with run.sh --host=127.0.0.1, but when i try to shutdown with ./shutdown.sh --server=127.0.0.1 --shutdown, something still tries to connect to the outside interface but can't, so it fails.

          here's my exception from running shutdown.sh:
          Exception in thread "main" javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 68.82.221.209; nested exception is:
          java.net.ConnectException: Connection refused]



          It's obvious from your own post that shutdown isn't being told that the server is at 127.0.0.1. The exception shows that a connection attempt was made to 68.82.221.208 and was refused.

          • 2. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
            jflinchbaugh

            ok, so if the --server=127.0.0.1 option to shutdown.sh doesn't do it, what does? if i try --server=<outside-interface> i get another shorter error. i think the initial connection to localhost:1099 is working, but a follow up connection is not.

            interestingly, when i telnet to localhost 1099, it spits binary junk at me, but in there i see the ip address of my outside interface after "UnicastRef2". maybe some component in the server is not picking up on the --host option i used with run.sh?

            • 3. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
              jflinchbaugh

              an strace shows that i'm trying to connect to 1098 on the outside interface. what in the 1099 connection is telling it to connect to :1098?

              • 4. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
                sudsy

                Go to your $JBOSS_HOME/server/default/conf directory and look at the jboss-service.xml file. Your naming service (JNP) should be using port 1099 and the RmiPort is configured as 1098. As to limitng JBoss to only the loopback port, I can't remeber how I achieved that and don't have time to search the configuration. Hopefully this will at least set you in the right direction.

                • 5. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
                  jflinchbaugh

                  i had not touched those configs, and they are using ${jboss.bind.address}, and i can connect to each port on localhost just fine.

                  looking at the jmx-console, i noticed that some url's, like for Invokers and such, have derived the hostname of my box, instead of setting it to the ip address, so i see url's like http://butterfly.hjsoft.com:8083/. this is the name pointing to my outside interface. how can i override this hostname that it guessed?

                  • 6. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
                    jflinchbaugh

                    to clarify my previous post, the configs in jboss-service.xml are binding the address to the jboss.bind.address variable, like most other configs.
                    (my last post seems to have lost that variable name.)

                    • 7. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
                      jflinchbaugh

                      i've resolved it. some faq's covered binding to 127.0.0.1. the server was finding the outside hostname and using that as the rmi address.

                      to override this hostname, i specify:
                      -Djava.rmi.server.hostname=127.0.0.1

                      then the naming service stops trying to tell the client to connect to rmi on the outside interface.

                      • 8. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
                        jflinchbaugh

                        thank you for helping me work my way through this one and identify the true root of the problem.

                        • 9. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
                          jflinchbaugh

                          would it be possible to have run.sh's --host option not only override the jboss.bind.address, but also the java.rmi.server.hostname? if the admin is forcing everything to listen on one interface, it would make sense to make sure any lookups anywhere are forced to return references to the working interface as well.

                          • 10. Re: jboss 3.2.3 listening on 127.0.0.1 and shutdown.sh won't
                            sudsy

                            Absolutely! When you started the server and specified the address explicitly then the $ in all the BindAddress tags should have ONLY included that address, not all the interfaces on the box. Then again, expected behaviour doesn't always map in JBoss. I'm glad I was able to at least steer you in the right direction but it's kind of ironic: I was only here to see if there were any responses to my lament about JBoss. Over 50 views and not a single response. [Shrug]