2 Replies Latest reply on May 19, 2004 5:23 PM by hildo

    NoRouteToHostException on standalone Win@K box

    hildo

       

      "hildo" wrote:
      Hi all. I'm getting an error, and I have no idea why. I've installed Jboss 4 on a Win2K Professional box, that's standalone (not on any network, no network cable attached, card exists). I've developed a J2EE app, and have successfully executed JUnit test cases which (I thought) emulated client connections.

      When I try to connect to the server from a Java client, I get the following exception:

      Exception in thread "main" com.bh.bplan.client.ServerAccessException: javax.nami
      ng.CommunicationException: No route to host: Datagram send failed [Root exceptio
      n is java.net.NoRouteToHostException: No route to host: Datagram send failed]
       at com.bh.bplan.client.UserContextImplementation.connect(UserContextImpl
      ementation.java:51)
       at com.bh.bplan.client.UserContextFactory.createUserContext(UserContextF
      actory.java:38)
       at com.edh.test.client.ConnectTest.main(ConnectTest.java:21)
      Caused by: javax.naming.CommunicationException: No route to host: Datagram send
      failed [Root exception is java.net.NoRouteToHostException: No route to host: Dat
      agram send failed]
       at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:10
      66)
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1166)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:486)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:479)
       at javax.naming.InitialContext.lookup(Unknown Source)
       at com.bh.bplan.client.ContextLookup.getUserRemoteHome(ContextLookup.jav
      a:34)
       at com.bh.bplan.client.UserContextImplementation.connect(UserContextImpl
      ementation.java:49)
       ... 2 more
      Caused by: java.net.NoRouteToHostException: No route to host: Datagram send fail
      ed
       at java.net.PlainDatagramSocketImpl.send(Native Method)
       at java.net.DatagramSocket.send(Unknown Source)
       at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:10
      41)
       ... 8 more


      I'm sure that my properties being passed into the Initial Context are correct. The example shows be using localhost:1099 as the URL, but I've used many combos (jnp://localhost:1099, 127.0.0.1:1099, etc) without any different result ....

      public class ConnectTest {
       public static void main(String args[]) throws ServerAccessException {
       Properties p = new Properties();
       p.setProperty("jndi.provider.url", "localhost:1099");
       p.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
       p.setProperty("jndi.url.pkgs.value","org.jboss.naming:org.jnp.interfaces");
      
       System.out.println("p=" + p);
      
       UserContextFactory cf = new UserContextFactory();
       System.out.println("Context Factory created");
      
       UserContext uc = cf.createUserContext(p);
       if (uc != null) {
       System.out.println("UserContext created!");
       uc.terminate();
       } else {
       System.out.println("UserContext NOT created!");
       }
       }
      }


      FYI, the createUserContext method on the Factory simply creates a new InitialContext object (presumably connecting to JBoss) and creates a Server Session bean. The Exception is in the InitialContext constructor...

      I've read one FAQ stream where it suggested setting some server properties, but also no change.

      Does anyone know what's going on here? It's a bit frustrating to think that I've got to be on a network to do work. ;)

      Thanks,
      Ed


        • 1. Re: NoRouteToHostException on standalone Win@K box
          hildo

          OK, I've changed from JBoss 4 to 3.2.3, and I'm getting a different exception, which is....

          Exception in thread "main" com.bh.bplan.client.ServerAccessException: javax.naming.CommunicationException: error setting options [Root exception is java.net.SocketException: error setting options]
           at com.bh.bplan.client.UserContextImplementation.connect(UserContextImplementation.java:51)
           at com.bh.bplan.client.UserContextFactory.createUserContext(UserContextFactory.java:38)
           at com.edh.test.client.ConnectTest.main(ConnectTest.java:22)
          Caused by: javax.naming.CommunicationException: error setting options [Root exception is java.net.SocketException: error setting options]
           at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1115)
           at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1223)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
           at javax.naming.InitialContext.lookup(Unknown Source)
           at com.bh.bplan.client.ContextLookup.getUserRemoteHome(ContextLookup.java:34)
           at com.bh.bplan.client.UserContextImplementation.connect(UserContextImplementation.java:49)
           ... 2 more
          Caused by: java.net.SocketException: error setting options
           at java.net.PlainDatagramSocketImpl.join(Native Method)
           at java.net.PlainDatagramSocketImpl.join(Unknown Source)
           at java.net.MulticastSocket.joinGroup(Unknown Source)
           at org.jnp.interfaces.NamingContext.discoverServer (NamingContext.java:1069)
           ... 8 more


          My netstat -a output is

          Active Connections
          
           Proto Local Address Foreign Address State
           TCP fozzie:echo fozzie:0 LISTENING
           TCP fozzie:discard fozzie:0 LISTENING
           TCP fozzie:daytime fozzie:0 LISTENING
           TCP fozzie:qotd fozzie:0 LISTENING
           TCP fozzie:chargen fozzie:0 LISTENING
           TCP fozzie:epmap fozzie:0 LISTENING
           TCP fozzie:microsoft-ds fozzie:0 LISTENING
           TCP fozzie:1025 fozzie:0 LISTENING
           TCP fozzie:1026 fozzie:0 LISTENING
           TCP fozzie:1029 fozzie:0 LISTENING
           TCP fozzie:1030 fozzie:0 LISTENING
           TCP fozzie:1048 fozzie:0 LISTENING
           TCP fozzie:1098 fozzie:0 LISTENING
           TCP fozzie:1099 fozzie:0 LISTENING
           TCP fozzie:1801 fozzie:0 LISTENING
           TCP fozzie:2103 fozzie:0 LISTENING
           TCP fozzie:2105 fozzie:0 LISTENING
           TCP fozzie:2107 fozzie:0 LISTENING
           TCP fozzie:3372 fozzie:0 LISTENING
           TCP fozzie:4444 fozzie:0 LISTENING
           TCP fozzie:4445 fozzie:0 LISTENING
           TCP fozzie:8009 fozzie:0 LISTENING
           TCP fozzie:8080 fozzie:0 LISTENING
           TCP fozzie:8083 fozzie:0 LISTENING
           TCP fozzie:8090 fozzie:0 LISTENING
           TCP fozzie:8092 fozzie:0 LISTENING
           TCP fozzie:8093 fozzie:0 LISTENING
           UDP fozzie:echo *:*
           UDP fozzie:discard *:*
           UDP fozzie:daytime *:*
           UDP fozzie:qotd *:*
           UDP fozzie:chargen *:*
           UDP fozzie:epmap *:*
           UDP fozzie:snmp *:*
           UDP fozzie:microsoft-ds *:*
           UDP fozzie:1027 *:*
           UDP fozzie:1028 *:*
           UDP fozzie:1047 *:*
           UDP fozzie:1162 *:*
           UDP fozzie:1645 *:*
           UDP fozzie:1646 *:*
           UDP fozzie:radius *:*
           UDP fozzie:radacct *:*
           UDP fozzie:3527 *:*
           UDP fozzie:1031 *:*
           UDP fozzie:1032 *:*


          I was really hoping that someone could tell me what's causing this, because I'm stumped. More specifics about the environment:

          Win2K Pro SP4
          JDK 1.4.2_01
          JBoss 3.2.3

          • 2. Re: NoRouteToHostException on standalone Win@K box
            hildo

            In case anyone's having this problem, here's how I got around it.

            I'm still using JBoss 4 (don't know if this fixes for JBoss 3, but I'm assuming it will). I've borrowed a hub from a friend, and basically used a network cable to connect my Win2K box and the hub. The Win2K box now happily thinks it's on the network, and can find the JBoss server.

            I'm assuming its a fault with Win2K, but I can live with this. Even if my friend wants his hib back, hubs are cheap.