NoRouteToHostException on standalone Win@K box
hildo Jan 21, 2004 4:20 PM
"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