EJB blocking lookup
I'm developing a little calculator using EJB technology, in particular JBoss Application Server and Eclipse as IDE.
Hashtable ht = new Hashtable();
ht.put(Context.PROVIDER_URL, "jnp://localhost:1090");
ht.put(Context.INITIAL_CONTEXT_开发者_高级运维FACTORY, "org.jnp.interfaces.NamingContextFactory");
Context jndiContext = new InitialContext(ht);
calculator = (FacadeRemote) jndiContext.lookup("Facade");
This is a snippet of code which tries to lookup a bean called "Facade", the problem is that lookup method invocation blocks the execution of the program.
The Jboss naming service by default runs on port 1099, did you change it to 1090 for a particular reason ?
Also, to further debug this, you could try and suspend the thread where the lookup is occuring, and send us that thread dump.
These are the default jndi properties that jboss is using (they are available automatically to your app if you have the necessary jboss client libraries in your classpath).
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
精彩评论