0 Replies Latest reply on Oct 21, 2004 7:34 AM by newhorizon

    Unable to instantiate org.jnp.interfaces.NamingContextFactor

    newhorizon

      Hi ,

      Below is the peace of section of client side code

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

      Properties prop = new Properties();
      prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      prop.put(Context.PROVIDER_URL,"localhost:8080");
      Context ctx = new InitialContext(prop);
      Object objref = ctx.lookup("First");
      FirstHome home = (FirstHome)javax.rmi.PortableRemoteObject.narrow(objref,FirstHome.class);
      First firstejb = home.create();
      System.out.println("Current Time: "+firstejb.getTime());

      I am unable to instantiate the class mention in bold letters and hence geeting the following error. "Cannot instantiate class: org.jnp.interfaces.NamingContextFactory class"
      I have included all the class files in client folder of jboss directory.

      Can anyone please look into possible reason of the error and suggest solution.

      Thanks