Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Stephane Eybert
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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(
[java] at org.apache.catalina.startup.Catalina.load(
[java] at org.apache.catalina.startup.Catalina.load(
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(
[java] at java.lang.reflect.Method.invoke(
[java] at org.apache.catalina.startup.Bootstrap.load(
[java] at org.apache.catalina.startup.Bootstrap.main(
[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.


Peter Johnson
Posts: 5856
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!