3 Replies Latest reply on Jun 28, 2003 8:19 AM by Juha Lindfors

    NoClassDefFoundError on deployment?

    toroisarockstar Newbie

      I'm new to JBoss. Just started on a JBoss project after working with WebLogic for the past 3 years. I'm trying to deploy a jar. The jar is built using ant. I have verified that all the classes are put into the jar with the proper path (i.e a class with the package com.test.ejb has a path of com/test/ejb in the jar) and my ejb-jar.xml and jboss.xml files appear in the jar under the path /web-inf. The J2EE.jar is in my system class path. When I deploy the jar i get the following error for every EJBi have defined:

      18:27:54,213 WARN [ServiceController] Problem creating service jboss.j2ee:jndiN
      java.lang.NoClassDefFoundError: javax/ejb/EJBHome
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
      at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClass...

      I didn't include the entire trace. Anyone know whats going on? Looks like a permissioning/security issue? I'm not really up on my JBoss configuration, can anyone offer any help with this problem?

      Thanks in advance.

        • 1. Re: NoClassDefFoundError on deployment?
          Jon Barnett Master

          Try having a blank classpath before calling the JBoss run.batr or run.sh. JBoss only needs JAVA_HOME to be set to the root directory of your JDK installation. The run script takes care of everything else necessary for the JBoss container environment. If you need to modify the run script so the first thing you do is locally set the CLASSPATH environment variable to blank.

          For trouble free operation, if running in Windows, make sure that your JDK and JBoss are not in a directory path that contains spaces in it. It isn't your current issue, but something to help you avoid any other problems.

          JBoss already has the J2EE support libraries in jboss-j2ee.jar and your inclusion a j2ee.jar in the system classpath may upset the JBoss runtime environment.

          Hope it helps.

          • 2. Re: NoClassDefFoundError on deployment?
            toroisarockstar Newbie

            Thanks, that fixed the problem. I'm guessing its b/c jboss-j2ee.jar and j2ee.jar have redundent classes? Anyhow NOW i get the following error:

            09:50:15,020 WARN [verifier] EJB spec violation:
            Bean : MobileFastPin
            Section: 22.2
            Warning: The Bean Provider must specify the fully-qualified name of the Java class that implements t
            e enterprise bean's business methods in the <ejb-class> element.
            Info : Class not found: com.test.mobile.ejb.fastpin.MobileFastPinEJB

            09:50:15,070 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.2.1/server/default/d

            The class clearly exists in the jar and this deploys fine on WebLogic 6.x. Anyone ever run into anything similar?

            Thanks in Advance

            • 3. Re: NoClassDefFoundError on deployment?
              Juha Lindfors Master

              It is still not finding the correct class so you have either a problem in your packaging or in your ejb-jar.xml file. Post the content of the jar and your deployment descriptor.