4 Replies Latest reply on Jun 6, 2005 11:11 AM by Tony Piazza

    Connect exception in LAN when network cord is pulled

    Bernie Meyer-Willner Newbie

      Hi,

      we have the following setup. JBoss 3.0.5 and client on the same machine
      (Win2000 or WinXP with Java 1.4.1x). The machine is connected to a LAN
      (TCP/IP set to automatic, i.e. DHCP).

      When we pull the network cord from the network adapter/card and try to
      connect to JBoss with our client (look up an EJB via JNDI) we get the
      following:

      javax.naming.CommunicationException. Root exception is
      java.rmi.ConnectIOExcept
      ion: Exception creating connection to: 158.234.148.187; nested exception is:
      java.net.NoRouteToHostException: No route to host: connect
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:580)
      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:484)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:463)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)

      The IP address contained in the stacktrace is the one my local machine had
      last. When I reconnect the network cord, the lookup works fine again.
      Remember, client and JBoss are on my same local machine.

      Why does the NoRouteToHostException occur? Is this a special Java problem on
      Windows when DHCP ist used? We use jnp://localhost:ourport to connect to the
      naming service. Putting in 127.0.0.1 or the "real" IP instead yields the
      same results.

      Any insight into this would be extremely helpful.