Cannot instantiate class: org.jnp.interfaces.NamingContextFa
xlahaut Aug 5, 2002 9:45 AMHelp !!!!!!!
I'm trying to instanciate a session bean in a client
Applet. All the necessary jar are attached to the applet, and I'm initializing the Context with all the necessary parameters... but I still have the Exception :
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory. Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:207)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.(InitialContext.java:195)
at applet.FileManager.getTheLetterSession(FileManager.java:47)
at applet.FileManager.getDownloadFile(FileManager.java:80)
Here is the code of the applet:
Properties jndiProps = new Properties();
jndiProps.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" ) ;
jndiProps.setProperty("java.naming.provider.url", "localhost" ) ;
jndiProps.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" ) ;
Context ctx = new InitialContext(jndiProps);
Object objref = ctx.lookup("ejb/session/LetterSession");
LetterSessionHome letterSessionHome = (LetterSessionHome)javax.rmi.PortableRemoteObject.narrow(objref, LetterSessionHome.class);
theLetterSession = letterSessionHome.create();
and here is the declaration of the applet in the jsp :
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.0 -->
<param name = ARCHIVE VALUE = "letter-template.jar, jboss-common-client.jar, jboss-client.jar, jboss-j2ee.jar, jbosssx-client.jar, jnp-client.jar, jndi.jar, jaas.jar, log4j.jar">
<param name = "clientLocalDirectory" value = '<%= session.getAttribute("clientLocalDirectory") %>'
<!--"END_CONVERTED_APPLET"-->
Is the order of the declaration of the jar is signifiant ?
I tried to instanciate explicitly a NamingContextFactory in my applet, and it works !!! So why have I this ClassNotFounException on the new InitialContext ?????????????????
I need help !!!!!