2 Replies Latest reply on Jul 13, 2003 10:32 AM by ephansen

    class loading: NoClassDefFoundError

    ephansen

      In a nutshell, it appears that JBoss/Jetty is not loading classes inside my .war application...

      It only does this, however, if I first load an mbean (via a -service.xml file) that uses a class (from a jar file in the ..server/default/lib). This mbean is dependent on a couple of other mbeans that create JMS queues. All of this deploys without any errors, and my custom mbean class works just fine.

      So... after all the JBoss and my custom mbeans have been deployed, I can, for example, drop the .war file into the deploy folder... it begins to load my StartupServlet.class (which buried in a package located in WEB-INF/classes) and then fails (NoClassDefFoundError) when it tries to instantiate a class that is also in the WEB-INF/classes/ path but in a different package. It also chokes when it needs a class in the WEB-INF/lib folder. It seems odd that the StartupServlet.class file is actually running (ie loaded by the classloader?) while other classes inside the .war file cannot.

      Now if I do not deploy my mbean that creates the JMS queues etc (delete the -service file from the deploy folder) then the .war application loads and runs without error.

      I am using JBoss 3.2.1 with Jetty on Win2k
      Any ideas???
      Thanks for any help!!!
      -Eric

        • 1. Re: class loading: NoClassDefFoundError
          ephansen

          a bit more information.....

          I also have to remove one of my jar files from the jboss/server/default/lib folder in order to make the .war application work fine. So there is something about that jar file that is causing the problem. I made sure that the offending class's package is not in the other jar file.

          Thanks.

          • 2. Re: class loading: NoClassDefFoundError
            ephansen

            alas, I found the problem... and it had nothing to do with class loading. It had to do with my stupidity and the placement of certain classes in the wrong packages.

            -Eric