3 Replies Latest reply on Aug 28, 2003 10:26 PM by wmprice

    Weird Class Instantiation Problem

    azydron

      Hi,

      We are hitting a bad problem under load with JBoss. We are experiencing javax.naming.NoInitialContextException exceptions under load running jboss-3.0.7_jakarta-tomcat-4.1.24 when trying to instantiate stateless session beans. The class specified in the error message is just '.'

      The errors are not consistent but apear to be related to system load. The specific error message does not give a class name the Exception message is:

      javax.naming.NoInitialContextException: Cannot instantiate class: .
      Root exception is
      java.lang.ClassNotFoundException:
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:195)
      at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:652)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
      at javax.naming.InitialContext.init(InitialContext.java:222)
      at javax.naming.InitialContext.(InitialContext.java:178)


      Our environment is as follows:

      O/S: SunOS 5.8 Generic_108528-09 sun4u sparc SUNW,Ultra-4

      Java: Java HotSpot(TM) Client VM (build 1.3.1_02-b02, mixed mode)

      JBoss Bootstrap Environment

      JBOSS_HOME: /export/home/jboss/jboss-3.0.7_jakarta-tomcat-4.1.24

      JAVA: /usr/java//bin/java

      JAVA_OPTS: -Xmx1024M -verbosegc -Dprogram.name=run.sh

      CLASSPATH: /export/home/jboss/config//xercesImpl.jar:/export/home/jboss/config
      //xml-apis.jar:/export/home/jboss/config//xalan.jar:/export/home/jboss/jboss-3.0
      .7_jakarta-tomcat-4.1.24/bin/run.jar:/usr/java//lib/tools.jar


      An example of the InitialContext connection code is:

      InitialContext iniCtx = new InitialContext();

      Object ref = iniCtx.lookup("java:comp/env/jdbc/TerminologyDS");

      We would appreciate some help and guidance as to the best way to circumvent this error.

      Thanks in advance,

      az

        • 1. Re: Weird Class Instantiation Problem

          Do you have any jndi.properties anywhere else
          besides server/default/conf? Or something changing the
          system properties?

          This is Sun code it hasn't got to jboss code yet.

          Also try closing your initial context after you are finished with it
          rather than relying on the garbage collector?

          Regards,
          Adrian

          • 2. Re: Weird Class Instantiation Problem
            azydron

            Hi Adrian,

            Thank you very much for your reply. We are closing the initial context. This is one of the things that we have already implemented. regarding jndi.properties we have several versions under the main jboss distribution directory (all, default and minimal). They are all identical and have the following content:

            java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
            java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
            # Do NOT uncomment this line as it causes in VM calls to go over
            # RMI!
            #java.naming.provider.url=localhost

            Regards,

            AZ

            • 3. Re: Weird Class Instantiation Problem

              I posted a reply to your other post....however, just to reiterate:

              Are you sure you have the jbossall-client.jar in your classpath?

              Weston