0 Replies Latest reply on Apr 21, 2005 4:19 AM by Tejinder Rawat

    javax.naming.NoInitialContextException: Cannot instantiate c

    Tejinder Rawat Newbie


      while running a client application for my j2ee application on the jboss i am getting following type of error:

      >>> Source code start here
      package au.com.chimo.nextidserver.wsclienttest;

      import javax.naming.Context;
      import java.util.Properties;

      /**
      * Created by IntelliJ IDEA.
      * User: shaun
      * Date: 21/07/2004
      * Time: 14:27:35
      */
      public class EJBBaseTest {

      protected Properties properties = null;
      public EJBBaseTest(){
      super();
      properties = new Properties();
      properties.put(Context.INITIAL_CONTEXT_FACTORY,

      "org.jnp.interfaces.NamingContextFactory");
      properties.put(Context.PROVIDER_URL, "jnp://localhost:1099");
      }

      }

      >>> Source code end here

      >>> Stack error trace(start here)
      javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf
      aces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: o
      rg.jnp.interfaces.NamingContextFactory]
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
      52)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
      )
      at javax.naming.InitialContext.init(InitialContext.java:219)
      at javax.naming.InitialContext.(InitialContext.java:195)
      at au.com.chimo.nextidserver.wsclienttest.EJBRegisterUserTest.(Unk
      nown Source)
      at au.com.chimo.nextidserver.wsclienttest.EJBRegisterUserTest$MyThread.r
      un(Unknown Source)
      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFac
      tory
      at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:219)
      at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.jav
      a:42)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
      49)
      ... 5 more




      >>> there is lot of stack trace of this type