0 Replies Latest reply on Mar 17, 2003 3:48 PM by Jik

    javax.naming.NoInitialContextException: Need to specify clas

    Jik Newbie


      We just started using JBoss (3.0.6) and have a servlet invoking an EJB in our application. But we are getting the above mentioned exception after JBoss runs fine for some time.

      We have bundled the servlet and ejb in an ear class and are making the ejb object lookup call as follows:

      javax.naming.InitialContext initial = new javax.naming.InitialContext();
      Object objref = initial.lookup("TestObject");

      The ear file is deployed successfully, and the request and responses work fine for some time eventually resulting in the above mentioned exception, thereafter the only way to continue forward is to restart the jboss.

      Our ejb-jar.xml for the ejb is like this:



      The application.xml in the ear file just specifies the the ejb in the tag as follows:


      We have used the default jboss's jndi.properties as it did not work (gave the same exception) have changed it to the following with no result:
      # Do NOT uncomment this line as it causes in VM calls to go over
      # RMI!

      If the problem is with jndi initialization, then why would the JBoss run well for a while, before starts giving the NoInitialContextException ? Most likely some setup/configuration issue, which am not able to fathom.

      Any insight into the problem is highly appreciated.

      Thank you.