3 Replies Latest reply on Sep 23, 2002 3:40 PM by benw

    NoClassDefFoundError

      Running JBoss 3.0.2.

      I've got a session bean that uses some classes I have in a jar file.

      It compiles fine, but I get a NoClassDefFoundError when I run my client against the session bean. The error is generated when the bean tries to find one of the classes in the Jar.

      I tried putting the jar in my server//lib dir and also in META-INF/lib (just guessing) and it can't seem to find the class.

      Where does one put a jar file that a bean needs access to?

      Thanks!

        • 1. Re: NoClassDefFoundError

          server//lib should be available
          to everything.

          But it is only loaded at startup.
          Did you restart the server?

          You can put jars in server//deploy
          for hot deployment

          Regards,
          Adrian

          • 2. Re: NoClassDefFoundError

            That worked. Don't know why it didn't before.

            Anyway, do you know of any way to put the jars required by the objects into the j2ee jar file so I do not have to put files into the /server//lib dir?

            I also don't want to have the util jars in the deploy dir. I would like to have them in the one jar that represents the whole app.

            Thanks!

            • 3. Re: NoClassDefFoundError
              benw

              Put them all in an .ear file. Refer to the Sun Java web site on how to create one (or a good J2EE book). Make sure that the MANIFEST.MF file in your application jar has a reference to the 3rd party jars.

              Ben