4 Replies Latest reply on Sep 27, 2002 12:33 PM by ctibor

    .NoClassDefFoundError: javax/ejb/SessionBean

    mohamed

      Hi There,

      I am trying to deploy a stateless EJB in JBOSS 3. and getting the following exceptions

      10:47:52,017 INFO [MainDeployer] Starting deployment of package: file:/D:/jboss-3.0.0/server/default/deploy/V3DDBEngineEJB.jar
      10:47:52,207 ERROR [EJBDeployer] Verfiy failed
      java.lang.NoClassDefFoundError: javax/ejb/SessionBean
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      ..............
      ........

      10:47:52,728 ERROR [MainDeployer] could not create deployment: file:/D:/jboss-3.0.0/server/default/deploy/V3DDBEngineEJB.jar
      java.lang.NoClassDefFoundError: javax/ejb/EJBHome
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      ...........
      ...........

      But this is not the case for all the beans, the deployment goes thru successfully for some beans.

      What could be the reason.

      Mohamed Zafer

        • 1. Re: .NoClassDefFoundError: javax/ejb/SessionBean
          tdang

          Be sure that you've added jar files of JBoss into your classpath.

          Regards.

          • 2. Re: .NoClassDefFoundError: javax/ejb/SessionBean
            mohamed

            Hi tdang,

            Thanks for your response, If classpath is the problem then how come I get the exceptions for only few beans, the other deplpoy fine.

            Zafer

            • 3. Re: .NoClassDefFoundError: javax/ejb/SessionBean
              ctibor

              I have the exact same issue. Some EJBs deploy without a problem while others fail during deployment with the error "NoClassDefFoundError:javax/ejb/..." . I am able to repeat this error in version 2.4.6 and version 3.0.0. Furthermore, I was able to take the "undeployable" EJBs and deploy them successfully to Sun's J2EE reference implementation server. Therefore, I am suspicious that this is an issue with JBoss rather than my beans.

              There is a work-around, but I am not sure why it works. If you start JBoss with the javax/ejb/* classes in the system classpath, there are no more NoClassDefFoundErrors and all of my beans deploy without any problems. Is there a classloader bug or issue within JBoss that is causing this behavior? Any insight would be greatly appreciated.

              Thanks,
              Chad

              • 4. Re: .NoClassDefFoundError: javax/ejb/SessionBean
                ctibor

                I have the exact same issue. Some EJBs deploy without a problem while others fail during deployment with the error "NoClassDefFoundError:javax/ejb/..." . I am able to repeat this error in version 2.4.6 and version 3.0.0. Furthermore, I was able to take the "undeployable" EJBs and deploy them successfully to Sun's J2EE reference implementation server. Therefore, I am suspicious that this is an issue with JBoss rather than my beans.

                There is a work-around, but I am not sure why it works. If you start JBoss with the javax/ejb/* classes in the system classpath, there are no more NoClassDefFoundErrors and all of my beans deploy without any problems. Is there a classloader bug or issue within JBoss that is causing this behavior? Any insight would be greatly appreciated.

                Thanks,
                Chad