Installed JBoss 4.0.4 on two servers with same configuration. Deployed an ejb3 application on both of them. On the client side, the following code is used to do the lookup:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, p.getProperty("URL", "server:1099"));
Context c = new InitialContext(env);
System.out.println("Lookup : " + System.currentTimeMillis());
myservice = (myservice) c.lookup(" myservicebean/remote");
System.out.println(System.currentTimeMillis());
The problem is that on one network, it takes about 500ms, and on the other network, it takes 15s. These two network are similar network (windows servers with a bunch of windows client. The slow one doesn't have internet connection though.). If I run the application on server machine only (JBOSS & Client application on same machine instead of two machines. i.e. install client on the server and change the above url to something like "localhost:1099)). The speed is fine.
The network itself seems not a problem. I used ping to test network speed on both network. It seems the slow one even has a faster roundtrip time.
So can anyone give me some hints on how to debug this kind of problem?
Thanks.