This has been reported on the users list http://mail-archives.apache.org/mod_mbox/tomcat-users/201502.mbox/%3CCAHvOsHzPt9hK8iGSTfXCzCcUSMq4N0DH5o1WRzTFvW-pKdVRRg%40mail.gmail.com%3E http://tomcat.markmail.org/thread/du5j6z54cw2pfdvz <quote> I'm using Tomcat 8.0.18. I've following ant build.xml: <import file="${tomcat.home}/bin/ catalina-tasks.xml"/> <target name="jspc"> <jasper validateXml="false" uriroot="${webapp.path}" webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml" outputDir="${webapp.path}/WEB-INF/src" /> <validator path="${webapp.path}" /> ... </target> <jasper> task works great, but <validator> task throws java.lang.NoClassDefFoundError: org/apache/catalina/Globals </quote> Searching the jars, "org/apache/catalina/Globals.class" is in catalina.jar, which is not listed in bin/catalina-tasks.xml I think that catalina-tasks.xml shall list all jars from ${catalina.home}/lib/*.jar, instead of naming just a few of those. Besides catalina.jar others that are missing are *-i18n-*.jar ones.
Fixed in trunk and 8.0.x for 8.0.19 onwards.
This is observed on 7.0.59 and current 6.0.x as well. I will backport the fix.
Complete sample build.xml (to be put into $CATALINA_HOME): [[[ <project default="jspc"> <property name="tomcat.home" location="${basedir}" /> <property name="webapp.path" location="${basedir}/webapps/examples" /> <import file="${tomcat.home}/bin/catalina-tasks.xml"/> <target name="jspc"> <jasper validateXml="false" uriroot="${webapp.path}" webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml" outputDir="${webapp.path}/WEB-INF/src" /> <validator path="${webapp.path}" /> </target> </project> ]]]
Fixed in Tomcat 7 by r1658815 and will be in 7.0.60. Proposed for Tomcat 6.
For a record: Stacktrace in Tomcat 6 is [[[ build.xml:15: java.lang.NoClassDefFoundError: org /apache/catalina/Globals at org.apache.catalina.ant.ValidatorTask.execute(ValidatorTask.java:95) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at ... ]]] The line that refers the Globals class in ValidatorTask.java: Digester digester = DigesterFactory.newDigester( true, true, null, Globals.IS_SECURITY_ENABLED);
Fixed in Tomcat 6 by r1660788 and will be in 6.0.44 onwards.