2 Replies Latest reply on Aug 7, 2003 9:50 AM by Steve Dodge

    jakarta-oro.jar in WEB-INF/lib

    Steve Dodge Newbie

      I have a WAR archive that uses the jakarta-oro framework. The first time it goes to load a class that imports something from jakarta-oro I get a NoClassDefFoundError for org/apache/oro/text/perl/MalformedPerl5PatternException

      My class imports and uses 2 classes from ORO:
      import org.apache.oro.text.perl.MalformedPerl5PatternException;
      import org.apache.oro.text.perl.Perl5Util;

      I packaged jakarta-oro.jar into my WAR at WEB-INF/lib and I still get the error.

      If I place jakarta-oro.jar into server/default/lib everything works.

      I'm using JDK 1.4.1_02 and JBoss 3.2.1, I'm not sure which version of ORO I'm using but it definitly has all the classes that I need.

      For portablility sake, I'd rather package ORO in WEB-INF/lib


        • 1. Re: jakarta-oro.jar in WEB-INF/lib
          Bernd Zeitler Expert

          Put the .war and the .jar in an .ear .


          • 2. Re: jakarta-oro.jar in WEB-INF/lib
            Steve Dodge Newbie

            My goal was to keep jakarta-oro.jar in WEB-INF/lib. But now after looking at the JBoss AdminDeveloper doc, I see what is going on and why it can never go in WEB-INF/lib.

            The dependent class that uses oro is loaded from a top-level common .jar in my ear which is loaded through the JBoss unified classloader. Reading the AdminDev Doc, I found out that everything in a war at WEB-INF/lib and WEB-INF/classes is loaded by the servlet container's classloader (in this case Tomcat 4.1.24). Classes loaded through the servlet container are not visible to anything outside of the servlet container. So, eventhough oro is loaded in WEB-INF/lib, the dependent class in the Jboss UCL cannot see the oro classes!

            I'll have to concede and load jakarta-oro in server/default/lib, oh well.