Bug 56003 - tool-wrapper.bat cannot report failures. because ExceptionUtils class is not on classpath
Summary: tool-wrapper.bat cannot report failures. because ExceptionUtils class is not ...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.0-RC10
Hardware: PC All
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-13 22:59 UTC by Konstantin Kolinko
Modified: 2014-01-14 12:10 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kolinko 2014-01-13 22:59:44 UTC
If I do something that results in an error, e.g. using Java 7u45 and running

> tool-wrapper.bat foo

it fails with 

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tomcat/util/ExceptionUtils
        at org.apache.catalina.startup.Tool.main(Tool.java:204)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.ExceptionUtils
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 1 more

The cause is that org.apache.catalina.startup.Tool depends on ExceptionUtils class that is not present in bootstrap.jar.

When I do something successfully, e.g. run

> digest.bat -a md5 helloworld

it completes successfully.


Alternatively, we can add lib/tomcat-util.jar to the classpath created by tool-wrapper{.bat|.sh} script, or add the ExceptionUtils class to bootstrap.jar.

Tool class also depends on org.apache.catalina.Globals, but that only pulls in several constant strings and does not cause problems at runtime.
Comment 1 Mark Thomas 2014-01-14 12:10:17 UTC
Fixed in 8.0.x for 8.0.0 onwards.