Hello,
I would like to access a remote EJB3. In the client, I use the following solution:
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL,
"localhost:1099");
env.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
Initialcontext context = new InitialContext(env);
It works fine, but I rather prefer to put the properties in a non-compiled file (web.xml for instance). Is it possible to do this ?
Thanks,
You can put the following into a jndi.properties file:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost:1099