Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Fix for *tomcat-digest* to generate password hashes
When using the *tomcat-digest* utility to create an SHA hash of Tomcat passwords, the command terminated unexpectedly with the *ClassNotFoundException* Java exception. A patch has been provided to fix this bug and *tomcat-digest* now generates password hashes as expected.
Description of problem:
1. When using cmd "tomcat-digest" in order to create a SHA hash of tomcat passwords,the cmd fails with below java exception.
~~~
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tomcat/util/ExceptionUtils
at org.apache.catalina.startup.Tool.main(Tool.java:230)
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
~~~
Version-Release number of selected component (if applicable):
~~~
Server version: Apache Tomcat/7.0.54
Server built: Mar 24 2015 07:49:05
Server number: 7.0.54.0
OS Name: Linux
OS Version: 3.10.0-229.el7.x86_64
Architecture: amd64
~~~
How reproducible:
1. [pankaj@dhcp Desktop]tomcat-digest (Use simple cmd with no parameter)
Actual results:
~~~
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tomcat/util/ExceptionUtils
at org.apache.catalina.startup.Tool.main(Tool.java:230)
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
~~~
Expected results:
~~~
[pankaj@dhcp Desktop]$ tomcat-digest -a SHA-256 Foo
Foo:1cbec737f863e4922cee63cc2ebbfaafcd1cff8b790d8cfd2e6a5d550b648afa
~~~
Additional info:
- It can be seen that the cause of error is due to the class "org.apache.tomcat.util.ExceptionUtils" is not available for the class loader during this early stage.The class "org.apache.tomcat.util.ExceptionUtils" is located in "/usr/share/tomcat/lib/tomcat-coyote.jar"
~~~~~~~~~
[pankaj@dhcp233-125 lib]egrep -ir "org.apache.tomcat.util.ExceptionUtils" /usr/share/tomcat/lib/
O/P : Binary file /usr/share/tomcat/lib/tomcat-coyote.jar matches
~~~~~~~~~
- We also need to add "/usr/share/tomcat/lib/tomcat-util.jar" to classpath or else the cmd will throw the error something like :
~~~
java.lang.NoClassDefFoundError: org/apache/tomcat/util/res/StringManager
at org.apache.catalina.util.LifecycleBase.<clinit>(LifecycleBase.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Tool.main(Tool.java:228)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.res.StringManager
~~~
Workaround :
- The simple workaround is just add the jar's "tomcat-util.jar" and "tomcat-coyote.jar" to his classpath.
eg : # CLASSPATH=/usr/share/tomcat/lib/tomcat-util.jar:/usr/share/tomcat/lib/tomcat-coyote.jar tomcat-digest -a md5 mycredentials
- The result would be it includes the missing .jar files needed by tomcat-digest.After adding these jar's the script works as expected.
Comment 2Michal Karm Babacek
2015-07-07 04:55:01 UTC
Dear Filip, could you try to reproduce it with our JWS3 RHEL7 RPM and ZIP distro?
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHSA-2016-2599.html
Description of problem: 1. When using cmd "tomcat-digest" in order to create a SHA hash of tomcat passwords,the cmd fails with below java exception. ~~~ Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tomcat/util/ExceptionUtils at org.apache.catalina.startup.Tool.main(Tool.java:230) 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 ~~~ Version-Release number of selected component (if applicable): ~~~ Server version: Apache Tomcat/7.0.54 Server built: Mar 24 2015 07:49:05 Server number: 7.0.54.0 OS Name: Linux OS Version: 3.10.0-229.el7.x86_64 Architecture: amd64 ~~~ How reproducible: 1. [pankaj@dhcp Desktop]tomcat-digest (Use simple cmd with no parameter) Actual results: ~~~ Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tomcat/util/ExceptionUtils at org.apache.catalina.startup.Tool.main(Tool.java:230) 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 ~~~ Expected results: ~~~ [pankaj@dhcp Desktop]$ tomcat-digest -a SHA-256 Foo Foo:1cbec737f863e4922cee63cc2ebbfaafcd1cff8b790d8cfd2e6a5d550b648afa ~~~ Additional info: - It can be seen that the cause of error is due to the class "org.apache.tomcat.util.ExceptionUtils" is not available for the class loader during this early stage.The class "org.apache.tomcat.util.ExceptionUtils" is located in "/usr/share/tomcat/lib/tomcat-coyote.jar" ~~~~~~~~~ [pankaj@dhcp233-125 lib]egrep -ir "org.apache.tomcat.util.ExceptionUtils" /usr/share/tomcat/lib/ O/P : Binary file /usr/share/tomcat/lib/tomcat-coyote.jar matches ~~~~~~~~~ - We also need to add "/usr/share/tomcat/lib/tomcat-util.jar" to classpath or else the cmd will throw the error something like : ~~~ java.lang.NoClassDefFoundError: org/apache/tomcat/util/res/StringManager at org.apache.catalina.util.LifecycleBase.<clinit>(LifecycleBase.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.catalina.startup.Tool.main(Tool.java:228) Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.res.StringManager ~~~ Workaround : - The simple workaround is just add the jar's "tomcat-util.jar" and "tomcat-coyote.jar" to his classpath. eg : # CLASSPATH=/usr/share/tomcat/lib/tomcat-util.jar:/usr/share/tomcat/lib/tomcat-coyote.jar tomcat-digest -a md5 mycredentials - The result would be it includes the missing .jar files needed by tomcat-digest.After adding these jar's the script works as expected.