2 Replies Latest reply on Oct 31, 2008 3:12 PM by Peter Johnson

    Shutdown exception...javax.naming.CommunicationException...

    Adym Lincoln Newbie

      Hi all,

      I've been working away at this issue for 4 hours now, and still can't find a solution. My JBoss server won't shutdown properly, receiving the following exception when I try and shutdown:

      [exception]
      Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Ro
      ot exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.Serv
      iceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused
      : connect]]]
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1416)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:596)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jboss.Shutdown.main(Shutdown.java:214)
      Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUn
      availableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: con
      nect]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1387)
      ... 4 more
      [/exception]

      The original issue started out during startup, the NamingContext could not obtain port 1099. I've since done the following:
      - Reconfigured jboss-service.xml to use ports 2099/2098
      - Set the jndi.properties file with java.naming.provider.url=http://localhost:2099
      - Using Tcpview to monitor port usage on my Windoze laptop.

      This fixed the startup cycle, and you can even see in the server log the NamingContext grab the 2099 during startup.

      However, even with those fixes, the shutdown cycle continues to throw exceptions like the above. I thought the issue might be related to the linkage between Eclipse Ganymede and the JBoss server, but a test using the command line tools for JBoss proves that not to be the case...I ran the JBoss server via the command line (run.bat) and then opened a second command console and issued a shutdown -S and got the same exception. It almost appears like there is a hard-coded value stored somewhere that I can't get to...

      Any help would be greatly appreciated...

      tia,

      adym