3 Replies Latest reply on Sep 25, 2002 1:35 PM by Adrian Brock

    InitialContext exception

    Eric White Newbie

      I am brand new to java and jboss. I have installed both 3.0.2 and 3.0.1 with Tomcat. I am getting the same problem on both.

      I have built the intro-interest bean and deployed it as per the documentation. The problem arises when I build the intro-interest-client. I have set the class path to joss_dist/client and to several of the jars in that directory. I have also copied the jndi.properties file that was included with the examples to the client directory. I have searched the forums and the documentation for a clue as to what I might be doing wrong, but have not found an answer.

      Building the client with ant, I get the following output (sorry for the format):

      L001910$ ant intro-interest-client
      Buildfile: build.xml

      validate-servlet:

      validate-jboss:

      fail_if_not_valid:

      init:
      [echo] Using JBoss directory=c:\jboss\jboss-3.0.1
      [echo] Using base classpath=C:\jboss\jboss-3.0.1\client\jboss-j2ee.jar;C:\jboss\jboss-3.0.1\client\jaas.jar;C:\jboss\jboss-3.0.
      1\client\jbosssx-client.jar;C:\jboss\jboss-3.0.1\client\jboss-client.jar;C:\jboss\jboss-3.0.1\client\jnp-client.jar;C:\jboss\jboss-3
      .0.1\catalina\common\lib\servlet.jar;c:\cygdrive\c\progra~1\cerner\web\xalan.jar:\cygdrive\c\progra~1\cerner\web\xerces.jar:\cygdriv
      e\c\jboss\jboss-3.0.1\client:\cygdrive\c\jboss\jboss-3.0.1\client\jnet.jar:\cygdrive\c\jboss\jboss-3.0.1\client\log4j.jar:\cygdrive\
      c\jboss\jboss-3.0.1\client\jnp-client.jar:\cygdrive\c\jboss\jboss-3.0.1\client\jbossmq-client.jar:\cygdrive\c\jboss\jboss-3.0.1\clie
      nt\jboss-client.jar:\cygdrive\c\jboss\jboss-3.0.1\client\jboss-j2ee.jar:\cygdrive\c\jboss\jboss-3.0.1\client\jboss-common-client.jar

      [echo] Using Source directory=C:\jboss\examples
      [echo] Using Build directory=C:\jboss\examples/build-examples

      intro-interest-client:

      compile:

      interest-client:
      [java] java.lang.NoClassDefFoundError: org/jboss/logging/Logger
      [java] at org.jnp.interfaces.NamingContext.(NamingContext.java:89)
      [java] at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:38)
      [java] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
      [java] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
      [java] at javax.naming.InitialContext.init(InitialContext.java:219)
      [java] at javax.naming.InitialContext.(InitialContext.java:175)
      [java] at org.jboss.docs.interest.InterestClient.main(InterestClient.java:27)
      [java] Exception in thread "main"
      [java] Java Result: 1

      BUILD SUCCESSFUL

      Total time: 2 seconds


      If anybody could tell me what I am doing wrong, I would greatly appreciate it.

      Thanks,
      -Eric

        • 1. Re: InitialContext exception
          Adrian Brock Master

          client/jboss-common.jar

          Regards,
          Adrian

          • 2. Re: InitialContext exception
            Johan Maritz Newbie

            Hi

            I had this exact error. The reason is still unclear to me, but here goes.

            The client needs to be able to see the following two JAR's in the classpath.
            1.) %JBOSS_HOME%\client\log4j.jar
            2.) %JBOSS_HOME%\client\jboss-common-client.jar

            These two JAR's are required to sort out the
            "[java] java.lang.NoClassDefFoundError: org/jboss/logging/Logger"

            I am unclear why the "client" needs to perform logging when I would imagine this to be a JBOSS function, but with out these two jars in the clients classpath it does not work.

            Can anyone tell me why these two JAR's are required by the client. I was using JBOSS3.0.2 and the examples provided on www.jboss.org : org.jboss.docs.interest.InterestClient.java

            • 3. Re: InitialContext exception
              Adrian Brock Master

              Some logging was added to client side, but it
              was supposed to optional.

              JBoss 3.2 includes a "fix" where logging is ignored
              if log4j.jar is not present.

              You still jboss-common-client.jar to load this
              null logger.

              Regards,
              Adrian