8 Replies Latest reply on May 23, 2008 12:00 PM by Heiko Wiesner

    java.lang.NoClassDefFoundError: org/jnp/server/NamingServer

    Heiko Wiesner Newbie

      Hello,

      i changed my development environment from Windows to a linux system.
      I copied my JBoss with all his configs and deployments.

      Now when i start my client, i get the following:

      Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/jnp/server/NamingServer
      at org.jboss.naming.java.javaURLContextFactory.(javaURLContextFactory.java:37)
      at java.lang.Class.forName0(Native Method)

      I started the client in my old environment in verbose mode, but this class was never opened.

      When i search for this class in docjar, i get jbossall-client.jar.
      This jar is in my classpath.

      I have the jboss 4.0.2

      thanks in advance

        • 1. Re:  java.lang.NoClassDefFoundError: org/jnp/server/NamingSe
          Peter Johnson Master

          Please post the full command line you use to run the client.

          I am surprise this class did not show up when you used -verbose:class - this class is needed for anything that uses JNDI, which is about anything that the client might do.

          Also, if the exception you post the full output for the client?

          • 2. Re:  java.lang.NoClassDefFoundError: org/jnp/server/NamingSe
            Heiko Wiesner Newbie

            Hello,

            the class i see in the verbose mode in the working environment is NamingServer_Stub
            from the jbossall_client and never NamingServer.

            Here is the full stacktrace

            Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/jnp/server/NamingServer
            at org.jboss.naming.java.javaURLContextFactory.(javaURLContextFactory.java:37)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:242)
            at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:50)
            at com.sun.naming.internal.ResourceManager.getFactory(ResourceManager.java:371)
            at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:575)
            at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:533)
            at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:279)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at de.test.pps.util.GenericFactoryUtil.lookupHome(GenericFactoryUtil.java:21)
            at de.test.pps.util.GenericFactoryUtil.getHome(GenericFactoryUtil.java:41)
            at de.test.pps.gui.Login.doLogin(Login.java:159)
            at de.test.pps.gui.Login.jPasswordField1KeyReleased(Login.java:139)
            at de.test.pps.gui.Login.access$1(Login.java:134)
            at de.test.pps.gui.Login$2.keyReleased(Login.java:98)
            at java.awt.Component.processKeyEvent(Component.java:5478)
            at javax.swing.JComponent.processKeyEvent(JComponent.java:2722)
            at java.awt.Component.processEvent(Component.java:5294)
            at java.awt.Container.processEvent(Container.java:1966)
            at java.awt.Component.dispatchEventImpl(Component.java:3984)
            at java.awt.Container.dispatchEventImpl(Container.java:2024)
            at java.awt.Component.dispatchEvent(Component.java:3819)
            at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1826)
            at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:681)
            at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:938)
            at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:810)
            at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:645)
            at java.awt.Component.dispatchEventImpl(Component.java:3857)
            at java.awt.Container.dispatchEventImpl(Container.java:2024)
            at java.awt.Window.dispatchEventImpl(Window.java:1791)
            at java.awt.Component.dispatchEvent(Component.java:3819)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

            best regards

            • 3. Re:  java.lang.NoClassDefFoundError: org/jnp/server/NamingSe
              Peter Johnson Master

              And the full command line used to run the client???

              • 4. Re:  java.lang.NoClassDefFoundError: org/jnp/server/NamingSe
                Heiko Wiesner Newbie

                Hello,

                There is no commandline. It is a Swing Client.

                Best regards

                • 5. Re:  java.lang.NoClassDefFoundError: org/jnp/server/NamingSe
                  Heiko Wiesner Newbie

                  hello,

                  maybe there is a problem with naming Service.
                  I can see the Nameservice Port with a portscanner.
                  But in the JMX Console i see the naming service started on the
                  expected port.
                  The jndi.properties are in the classpath of the client.

                  What could that be?

                  best regards

                  • 6. Re:  java.lang.NoClassDefFoundError: org/jnp/server/NamingSe
                    Peter Johnson Master

                    Even swing clients have command lines.

                    Are you running on Windows? If so, get the listdlls utility from sysinternals () )and run it:

                    listdlls java

                    or

                    listdlls javaw

                    That will tell you the command line used to run the app. Unless someone has implemented their own executable that loads the JVM, in which case the typical command line options are hidden in the executable (I hate it when that happens, extremely frustrating to reconfigure if the person who wrote the executable made invalid assumptions about the hardware on which I am running the app.)

                    How do you go about setting the classpath for the app? Does it get it from CLASSPATH env var? If so, post that.

                    These two statements confuse me:

                    I can see the Nameservice Port with a portscanner.
                    But in the JMX Console i see the naming service started on the
                    expected port.


                    Is there a "not" missing somewhere? Also, what is in the jndi.properties file?


                    • 7. Re:  java.lang.NoClassDefFoundError: org/jnp/server/NamingSe
                      Peter Johnson Master

                      Oh, I see you said that you moved from Windows to Linux, so I assume you are running the client on Linux now. The ps command should provide the command line (though you will have to redirect stdout to get the full line).

                      • 8. Solved:  java.lang.NoClassDefFoundError: org/jnp/server/Nami
                        Heiko Wiesner Newbie

                        Hello,

                        i have solved the problem.
                        It was a missing library.
                        The jbossall-client was in the classpath, but that was not enough.
                        I added all jboss client libs and now it's working.

                        thx for your help