5 Replies Latest reply on May 23, 2003 10:25 AM by ran488

    EJB Deployment - NoClassDefFoundError for file that exists

      I am having trouble deploying a Stateless Session EJB to JBoss 3.2.0 (JDK 1.4.1_02, Windows 2000/Cygwin).

      I get a NoClassDefFoundError for TsrSearchForm, which is a STRUTS form bean.

      I have verified that this class does exist in the cap-stats-ejb.jar file. This jar file is in an EAR file, along with a WAR file that also contains the TsrSearchForm class.

      I have checked the package and class names over and over, and they are correct.

      A coworker seemed suggested that I change the "Java2ClassLoadingCompliance" attribute to false in the jbossweb-jetty.sar/META-INF/jboss-service.xml file. When I did this, I still got the error, and the JMX console wouldn't even come up.

      Any other ideas?

      Here is the relevant snippet of my server.log:


      2003-05-14 11:22:46,742 WARN [org.jboss.ejb.EJBDeployer] Verify failed; continuing
      java.lang.NoClassDefFoundError: com/frontiercorp/bss/cap/stats/web/form/TsrSearchForm
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:1627)
      at java.lang.Class.privateGetPublicMethods(Class.java:1655)
      at java.lang.Class.getMethods(Class.java:815)
      at org.jboss.verifier.strategy.AbstractVerifier.hasEJBCreateMethod(AbstractVerifier.java:647)
      at org.jboss.verifier.strategy.EJBVerifier20.verifySessionBean(EJBVerifier20.java:1036)
      at org.jboss.verifier.strategy.EJBVerifier20.checkSession(EJBVerifier20.java:92)
      at org.jboss.verifier.BeanVerifier.verify(BeanVerifier.java:159)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:480)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:776)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:280)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:273)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:392)
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:242)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:597)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:361)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:268)
      at org.jboss.Main.boot(Main.java:156)
      at org.jboss.Main$1.run(Main.java:394)
      at java.lang.Thread.run(Thread.java:536)

        • 1. Re: EJB Deployment - NoClassDefFoundError for file that exis
          oli

          Hi,

          think you have in the JBoss.xml this line: <ejb-name>TestSession</ejb-name>
          and you have to in your client this lookup: ctx.lookup("TestSession");

          You can check it with your browser: http://localhost:8080/jmx-console/
          jboss --> service=JNDIView --> java.lang.String list()
          this is the last option of this site: press the invoke -Button

          You have to see
          EjB Module: .jar
          java:comp namespace of the <Namefrom JBoss.xml <ejb-name>TestSession</ejb-name> > bean:

          You have to for your client lookup: ctx.lookup(" <Namefrom JBoss.xml <ejb-name>TestSession</ejb-name>");

          I had the same problem Have a look to my posting.
          You can copy and past the source code from the posting:
          NameNotFoundException JNDI Problem Oli May 8, 2003 12:39 AM
          Juha and warjort had help me to solve the problem.

          Cue,
          Oli

          • 2. Re: EJB Deployment - NoClassDefFoundError for file that exis

            Actually I am having a totally different issue than what you are referring to, but thanks anyways.

            My EJB is deploying and binding to JNDI OK, but it is failing the verifier and failing to actually start because of a helper class not being found.

            From talking to other developers here who have had similar problems, I think the issue is with the class existing in both the WAR and EJB JAR file within the same EAR file. The classloader might be getting "confused" or something like that. I have a list of suggestions to try, so I'll be going through those.

            • 3. Re: EJB Deployment - NoClassDefFoundError for file that exis
              rastadg

              I also use struts and face the same problem but only with one of the form beans. The rest of the beans deploy successfully.

              I don't have an answer, but some thoughts:

              My EJB resides in the same .jar as the struts form bean, still the verifier's classloader cannot find the bean. The .jar file also deploys before the EJB's so the classloader should be able to find the file (and it does with all the other beans). Currently I'm trying to get the .jar file visible to the verifier's classloader.

              Another strange behavior is that the EJB deploys successfully on JBoss 3.2.1 running W2000, but fails on Solaris 8. Ant i also failed once on W2K but deploys now (I've changed the deployment order since it failed) so I'm pretty sure it has soemthing to do with the verifier not having the .jar in its path.


              I'll let you know if I fix the problem ...

              Bye for now.

              • 4. Re: EJB Deployment - NoClassDefFoundError for file that exis
                rastadg

                I've got it!!

                Just put struts.jar in /server//lib

                • 5. Re: EJB Deployment - NoClassDefFoundError for file that exis

                  Yup, after getting some debugging tips from the JBoss mailing list, I changed my Ant build script to include the Struts jar file in my ejb jar file, and it worked fine.

                  I would have expected the "class def not found" errors to specify the parent class name instead of my subclass name.