1 Reply Latest reply on Apr 5, 2006 5:47 AM by baptiste

    NoRouteToHost errors when losing network on autonomous machi

    baptiste

      Hi all,

      I work on a 3-tiered application with a RDBMS, a JBoss 4.0.1 appserver and Swing clients. For testing purposes, everything is deployed on the same machine: no network calls are made.

      The problem is, I get NoRouteToHost errors during EJB accesses when I unplug the network cable of the machine during a system run. When I unplug the cable before starting the system, everything works fine.

      The detail of the error is:

      java.net.NoRouteToHostException: No route to host: connect]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      ...
      Caused by: java.rmi.ConnectIOException: Exception creating connection to: 192.168.1.27; 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:544)
      


      I tested a bit with InetAddress.getLocalHost(), and it seems that a network loss causes the IP address of the machine to be reset to 127.0.0.1 and invalidates its previous address, which causes JNDI calls to fail.

      I known my problem is more Java-related than JBoss-related, but I hope other JBoss users might have encountered it and found workarounds. Sorry for the noise I may have created.

      Regards,
      Baptiste