[jboss-user] [JNDI/Naming/Network] - java.lang.ClassNotFoundException: org.jnp.interfaces.NamingC
forumer
do-not-reply at jboss.com
Thu Dec 14 03:30:41 EST 2006
JBoss 4.0.4-CR2, EJB 3.0
I have a client which accesses EJB's successfully when I create the InitialContext as follows:
| ctx.addToEnvironment("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| ctx.addToEnvironment("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
| ctx.addToEnvironment(Context.PROVIDER_URL,"jnp://localhost:1099");
|
|
|
However, if I place these properties in a jndi.properties file, instead, under a folder and include this folder in the classpath
|
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=jnp://localhost:1099
|
|
I get the error:
|
| javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory ]
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
| at javax.naming.InitialContext.init(InitialContext.java:223)
| at javax.naming.InitialContext.<init>(InitialContext.java:175)
|
|
I'd like to use a jndi.properties file instead of doing it in the code.
I'd appreciate any suggestions on why this might be happening.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993730#3993730
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993730
More information about the jboss-user
mailing list