3 Replies Latest reply on May 25, 2006 9:55 AM by Urs Wagner

    java classpath question

    Urs Wagner Novice

      I use the command java -classpath .;C:\Programme\JBoss\server\default\lib test.de.laliluna.library.FirestEJB3TutorialClient.

      I get the displayed error stack. When I specifiy jnpserver.jar in the classpath option, I get the next excpetion
      java.lang.NoClassDefFoundError: org/jboss/logging/Logger
      My questions are:
      1) I do understand why I should specifiy explicitly the jar name and not only the directory name?
      2) In which jar library is the JBoss logger class org.jboss.logging.Logger?


      javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
      at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
      at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
      at javax.naming.InitialContext.init(Unknown Source)
      at javax.naming.InitialContext.<init>(Unknown Source)
      at test.de.laliluna.library.FirstEJB3TutorialClient.main(Unknown Source)
      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
      ... 5 more
      Exception in thread "main" java.lang.RuntimeException: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
      at test.de.laliluna.library.FirstEJB3TutorialClient.main(Unknown Source)
      Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
      at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
      at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
      at javax.naming.InitialContext.init(Unknown Source)
      at javax.naming.InitialContext.<init>(Unknown Source)
      ... 1 more
      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
      ... 5 more


        • 1. Re: java classpath question
          bhupendra yaduvenshi Newbie

          First add the jnpclient.jar & chek it out if any problem com thna let me know

          • 2. Re: java classpath question
            Urs Wagner Novice

            I have the same problem


            java -cp .;%JBOSS_HOME%\client\jnp-client.jar test.de.laliluna.library.FirstEJB3TutorialClient

            Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logging/Logger
            at org.jnp.interfaces.NamingContext.<clinit>(NamingContext.java:158)
            at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:56)
            at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
            at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
            at javax.naming.InitialContext.init(Unknown Source)
            at javax.naming.InitialContext.<init>(Unknown Source)
            at test.de.laliluna.library.FirstEJB3TutorialClient.main(Unknown Source)


            • 3. Re: java classpath question
              Urs Wagner Novice

              This works better.


              java -cp .;%JBOSS_HOME%\client\jbossall-client.jar test.de.laliluna.library.FirstEJB3TutorialClient


              Now I get the "standard" NameNotFound Exception Bean not bound.