[jboss-user] [EJB 3.0] - Re: JUnit testing EJBs: NoInitialContextException

PeterJ do-not-reply at jboss.com
Thu Sep 7 14:15:51 EDT 2006


Create a jndi.properties file, place it in the classpath (usually in the base directory of the jar file), with these contents:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
  | java.naming.provider.url=localhost:1099
  | java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Of course, replace locahost with your host name if you are attempting remote access.

You can also provide those same properties within the application by creating a hash map and passing it to the InitialContext constructor.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970164#3970164

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970164



More information about the jboss-user mailing list