File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes java.lang.NoSuchMethodError: org.apache.tomcat.util.digester.Digester.setRulesValidation(Z)V Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "java.lang.NoSuchMethodError: org.apache.tomcat.util.digester.Digester.setRulesValidation(Z)V" Watch "java.lang.NoSuchMethodError: org.apache.tomcat.util.digester.Digester.setRulesValidation(Z)V" New topic
Author

java.lang.NoSuchMethodError: org.apache.tomcat.util.digester.Digester.setRulesValidation(Z)V

Stephane Eybert
Ranch Hand

Joined: Mar 15, 2010
Posts: 34
Hello,

I'm trying to start Tomcat from an Ant script but the Bootstrap class cannot be found.

Here is the Ant target:



The run displays:

[echo] ====>> lib/tomcat-6.0.20
[echo] ====>> /home/stephane/programs/jdk1.6.0_21/jre
[java] java.lang.NoSuchMethodError: org.apache.tomcat.util.digester.Digester.setRulesValidation(Z)V
[java] at org.apache.catalina.startup.Catalina.createStartDigester(Catalina.java:268)
[java] at org.apache.catalina.startup.Catalina.load(Catalina.java:474)
[java] at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
[java] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)
[java] Java Result: 1

Here are the jar files:

ll lib/tomcat-6.0.20/lib/
total 1748
-rwxr-xr-x 1 stephane stephane 28080 2012-01-19 14:23 bootstrap.jar
-rwxr-xr-x 1 stephane stephane 1146570 2012-01-19 11:32 catalina.jar
-rw-r--r-- 1 stephane stephane 116261 2006-09-01 06:22 catalina-optional.jar
-rw-r--r-- 1 stephane stephane 60841 2007-11-22 01:28 commons-logging-1.1.1.jar
-rw-r--r-- 1 stephane stephane 52313 2007-11-22 00:28 commons-logging-api-1.1.1.jar
-rw-r--r-- 1 stephane stephane 88537 2009-06-11 18:36 servlet-api.jar
-rw-r--r-- 1 stephane stephane 38019 2012-01-20 16:09 tomcat-juli.jar
-rw-r--r-- 1 stephane stephane 246343 2012-01-20 16:16 tomcat-util-5.5.4.jar


I solved it by having a more recent version of tomcat util.

Although it triggered another exception.

Sigh..

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Before you tried this, did you look at what parameters are passed to java to start Tomcat? You are missing a number of property settings, such as catalina.home, and the classpath needs only the tools.jar and the bootstrap.jar (Tomcat figures out the rest of the JARs using the properties).

You appear to be running on Linux. Start up Tomcat from a command prompt using the start.sh script. Then run:

ps -ef | grep java > ps.txt

and look at the command line passed to java. Mimic that in your Ant script.

By the way, I imagine that there is already a Tomcat Ant task that does this for you, not sure if you would be interested in that instead.


JBoss In Action
 
 
subject: java.lang.NoSuchMethodError: org.apache.tomcat.util.digester.Digester.setRulesValidation(Z)V