2 Replies Latest reply on Jun 24, 2004 1:28 AM by Andrew Oliver

    3.2.4 Classloading Issue

    Jack Frosch Newbie

      I'm having a classloading problem in 3.2.4 that I wasn't having in 3.2.3.

      I downloaded 3.2.4, unzipped it, and dropped the same EAR file that was working in 3.2.3 into the deploy directory. To my surprise, I got a NoClassDefFoundError when JBoss complained about not finding a particular class.

      I wanted to be sure this is happening in 3.2.4 and not 3.2.3, so I switched back to the 3.2.3 server, removed the EAR file from the 3.2.3 deploy directory and deleted the tmp and work directories. I started the 3.2.3 server and redeployed the EAR file. I had no problem. I then repeated the steps on the 3.2.4 server and again got the NoClassDefFoundError.

      The EAR file contains a non-EJB JAR file that holds the "missing class". It was packaged that way because multiple EJBs make reference to the same class. Also, the EAR file MANIFEST.MF file lists the JAR file containing the "missing" class in its Class-Path line. Each of the EJB JAR manifest files also list the same JAR file on the Class-Path line.

      So it seems the common JAR classes are not loaded by, or at, the time the EJBs are being deployed, hence the error.

      Any suggestions for handling this situation?



        • 1. Re: 3.2.4 Classloading Issue
          Jack Frosch Newbie

          Okay, I admit it. I was completely faked out by the NoClassDefFoundError message. Here's what happened:

          The NoClassDefFoundError flagged class A, but A was present in a JAR file that was part of the EAR file and listed on the Class-Path line in the MANIFEST.MF. That's what was throwing me.

          Then I wondered if maybe its ancestor class was missing? No, it was present, too. Then I checked the declared interfaces.

          That's when I discovered an interface from a 3rd party JAR (Hibernate) implemented by an ancestor class was missing from the deployment. The Hibernate JAR was deployed in my 3.2.3 server, but not in the 3.2.4 server.

          I've probably been here before, but that #%$&@ NoClassDefFoundError is just so misleading! It says XYZ class isn't found (No-Class-Def-Found), but that's not the problem at all! It's there alright - and I saw nothing in the stack trace gave the slightest hint there was another class or interface that was really the problem. I guess that's the only error ClassLoaders know about, but it would sure be helpful if the class loader error said, "Unable to load class XYZ because the ABC interface it depends on wasn't found."

          I'm sorry for taking up your time. Thanks for letting me vent a little.


          • 2. Re: 3.2.4 Classloading Issue
            Andrew Oliver Master

            I've been having this issue since Java 1.1.