3 Replies Latest reply on Aug 31, 2004 7:25 PM by anil.saldhana

    NoClassDefFoundError

    biggeronimo

      Hi,

      I have deployed a bean, which try to use some classes from a jar.
      The jar exists in the ear file. After making a request, the server throws a java.lang.NoClassDefFoundError exception.

      I have copied the jar file to the server/default/lib directory, but the server still can not find the class in the jar. I have modified the run.bat file and I have included this file into JBOSS_CLASSPATH, but still nothing.

      Do you have any suggestion where to copy this jar file to can be visible by the JBoss app server ? (I am using the RC1 release)

      Thanks.

        • 1. Re: NoClassDefFoundError
          mchauhan

          I see that this user has already posted this twice.

          Biggeronimo - what version are you at?

          Can someone help out please, This happens quite often but once it happens its reproducible consistently. The work around for us has been to remove the deploy directory and restart again (not sure if we can consistently do that either - but this has seemed to work), Thanks in advance
          --

          • 2. Re: NoClassDefFoundError
            anil.saldhana

            server/default/lib is the place to put jar files that are statically deployed in JBoss.

            "NoClassDefFoundError" happens usually for the following:
            a) your class A has been deployed to the server elsewhere and the server is finding a old version of it [This happens with Tomcat]

            b) You have not packaged the class that is bombing (NoClassDef) along with the classes that use it. Put it in the same jar file.

            • 3. Re: NoClassDefFoundError
              anil.saldhana

              This error is annoying but sit back and try to think why it is showing this error. Then check all your libraries for the existence of the class file.