6 Replies Latest reply on Mar 23, 2004 7:51 AM by ahardy66

    Shocked and stunned from JBOSS!

    Zeron Newbie

      Hello All,

      I am using Jboss 3.2.3 .. and I'm shocked!

      I am a JBoss newbie..
      I was really surprized how easy it is to deploy something under JBoss, but then things went bad. REALLY BAD...

      I'm doing something VERY easy, trying to deploy a single ejb. No external dependencies.. nothing.
      It is packaged in a single jar file like this:

      mycomp/
      --- /ejb/myejb/
      --------/AAAHome.class
      --------/AAABean.class
      --------/AAA.class
      --------/AAAException.class
      --------/model/
      ----------------/Foo.class
      ----------------/Bar.class
      META_INF/
      ---ejb-jar.xml
      ---jboss.xml


      There is nothing out of ordinary in ejb-jar.xml or jboss.xml they define only one SLSB ejb.

      when I copy the provision.jar (the ejb I want to deploy) to the server/default/deploy folder, the deployment starts but fails with this exception:

      =============================================

      2004-03-19 16:59:27,304 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/D:/jboss-3.2.3/server/default/deploy/provision.jar
      2004-03-19 16:59:27,874 WARN [org.jboss.ejb.EJBDeployer] Verify failed; continuing
      java.lang.NoClassDefFoundError: mycomp/ejb/myejb/AAAException
      at java.lang.Class.getMethods0(Native Method)
      at java.lang.Class.getMethods(Class.java:737)
      at org.jboss.verifier.strategy.AbstractVerifier.hasEJBCreateMethod(AbstractVerifier.java:688)
      at org.jboss.verifier.strategy.EJBVerifier11.verifySessionBean(EJBVerifier11.java:551)
      at org.jboss.verifier.strategy.EJBVerifier11.checkSession(EJBVerifier11.java:97)
      at org.jboss.verifier.BeanVerifier.verify(BeanVerifier.java:159)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:475)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
      at org.jboss.Main.boot(Main.java:150)
      at org.jboss.Main$1.run(Main.java:395)
      at java.lang.Thread.run(Thread.java:479)
      2004-03-19 16:59:28,235 ERROR [org.jboss.deployment.MainDeployer] could not create deployment: file:/D:/jboss-3.2.3/server/default/deploy/provision.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
      at org.jboss.Main.boot(Main.java:150)
      at org.jboss.Main$1.run(Main.java:395)
      at java.lang.Thread.run(Thread.java:479)

      ==============================================


      The class it can't find is jsut there sitting in the jar !!!!!
      How come????
      Please help! Am I missing something?

      zeron

        • 1. Re: Shocked and stunned from JBOSS!
          dannyyates Newbie

          The JAR file layout you quote appears to show AAAException.class in mycomp/ejb, not mycomp/ejb/myejb. Perhaps this is the problem?

          • 2. Re: Shocked and stunned from JBOSS!
            Joachim Van der Auwera Expert

            First guess, it is not the exception class which is not found, but a class it uses or extends (could even be an uninitialised member variable).

            Joachim

            • 3. Re: Shocked and stunned from JBOSS!
              Zeron Newbie

              Hello!
              Thanx for the reply and help.
              I like JBoss but I don't like the lack of docs for it... :)

              triathlon98, thank you.
              You guess was JUST right. AAAException was extending another exception which I'm bundling in a seperate jar file. I copied that jar to the /deploy folder, then tried to deploy the ejb... and guess what?? it worked!!

              It was a very simple mistake, but I wonder.. how come the stack trace for the error did not contain any hint about the root class which is missing??? Guess JBoss needs to include the relevant errors in there, no?? :)

              will go now to the second step of my journey (actually what I'm trying to do is to port our read-and-running application to JBoss).

              Wish me luck.. I believe I'll need your support later on too.
              thank you all again..

              zeron

              • 4. Re: Shocked and stunned from JBOSS!
                Joachim Van der Auwera Expert

                 


                It was a very simple mistake, but I wonder.. how come the stack trace for the error did not contain any hint about the root class which is missing??? Guess JBoss needs to include the relevant errors in there, no?? :)


                Nothing JBoss specific, this is just how Java works. The classloader tries to load the class and fails because not all required classes are found. This results on a ClassNofFoundException when trying to load named class. Complain to Sun...

                Joachim

                • 5. Re: Shocked and stunned from JBOSS!
                  Zeron Newbie

                  Yes, NoClassDefFoundError is thrown to tell you that you are missing a class, and I don't know where to load it from...

                  In my case:
                  AAAException extends BaseException

                  BaseException was not included. OK.
                  I am just wondering here, why can't the ClassLoader say: "I cannot find class definition for BaseException while trying to load AAAException " ???

                  It says: "I cannot find class definition for AAAException".
                  Misleading, ain't it??

                  And I guess the ClassLoader which is trying to load the missing class is one of the JBoss class loaders..
                  Pls, correct me if I'm wrong...

                  zeron

                  • 6. Re: Shocked and stunned from JBOSS!
                    ahardy66 Novice

                    Hey Zeron, I've been there & done that. I spent a whole day on this one and related errors, and found the best solution was to tidy up my development environment so that the class path available when I compile is exactly the same or more restricted than the class path used by JBoss's class loader.

                    It meant taking my project apart and putting it back together as 3 seperate ones, but now I'm confident where the classes are going to be and I don't have to wing it anymore.

                    Plus of course after spending so long hunting down the exception's cause, I will now for evermore associate 'class not found' with this problem.... :)