JBoss & JNDI Initial Context


EJB programming & troubleshooting: JBoss & JNDI Initial Context

  1. JBoss & JNDI Initial Context (2 messages)

    I'm running JBoss 2.2.1 on Windows 2000 without any problems. However, I have a question regarding JNDI naming services:
    I'm running the Interest EJB that comes with JBoss to test its EJB functionality. The EJB compiled and deployed without problem. However, I can't get the client to run because of the following error:
    javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory
    [Root exception is java.lang.ClassNotFoundException:
    Here is how my properties are setup:
    Properties env = new Properties();
    env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    env.setProperty("java.naming.provider.url", "localhost:1099");
    env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
    Obviously, I have the java.naming.factory stuff setup wrong. The above env entries are default entries that apply to JBoss, I think. So why don't they work? Do I have an alternative?
    Thanks in advance,
  2. JBoss & JNDI Initial Context[ Go to top ]

    make sure the jnpserver.jar is in your classpath with you compile and run the client. It is located in the
    %JBOSS_HOME%\lib\ext directory
  3. JBoss & JNDI Initial Context[ Go to top ]

    I got the same problem. However, after carefully checked the latest documentation for jboss 2.1+ I was able to fix the problem.