Search code examples
javatomcatservletsapache-commons

Java: Which Apache Digester Class?


I'm supporting a web application / Java servlet that has been failing to start. The issue turns out to be a relatively straight-forward java.lang.NoClassDefFoundError exception, thrown by org.apache.webapp.balancer.RulesParser.

The filter class that throws the exception expects the Digester class to exist in the package:

org/apache/tomcat/util/digester

That package doesn't appear to exist in the application lib, but there is an instance of the class in:

org/apache/commons/digester

Which is part of our current application / project. Both of the classes extend org.xml.sax.helpers.DefaultHandler so I'm assuming they are the same class (but probably different dates / versions)?

The RulesParser class exists in the catalina-balancer.jar (I don't have the source), so I can't change the package import directly.

What is the later version of the class and which version should I be using (and how)?


Solution

  • The class you are looking for is in the Tomcat folder. %TOMCAT_HOME%/server/lib/tomcat-util.jar Make sure you haven't overridden the default classpath/loader and forgot to add in the Tomcat directories