Bug 1655456 - Several exceptions happen during the start-up/shutdown of RHEL 7 Tomcat7 which run on Java 11
Summary: Several exceptions happen during the start-up/shutdown of RHEL 7 Tomcat7 whic...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tomcat
Version: 7.7-Alt
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Coty Sutherland
QA Contact: tomcat-qe
URL:
Whiteboard:
Depends On: 1678714
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-03 08:27 UTC by Masafumi Miura
Modified: 2019-11-25 06:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-05 14:41:29 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3728371 None None None 2018-12-03 08:41:14 UTC

Description Masafumi Miura 2018-12-03 08:27:33 UTC
### Description of problem:

Several exceptions happen during the start-up/shutdown of RHEL 7 Tomcat7 which run on Java 11.


### Version-Release number of selected component (if applicable):

tomcat-7.0.76-8.el7_5.noarch
tomcat-webapps-7.0.76-8.el7_5.noarch
java-11-openjdk-11.0.1.13-3.el7_6.x86_64


### How reproducible:

Anytime when running on Java 11


### Steps to Reproduce:

1. Install tomcat and OpenJDK 11
~~~
sudo yum install tomcat tomcat-webapps java-11-openjdk
~~~
2. Update JAVA_HOME to point to OpenJDK 11 in /etc/tomcat/tomcat.conf like:
~~~
JAVA_HOME="/usr/lib/jvm/jre-11-openjdk"
~~~
3. Start and stop tomcat service
~~~
sudo systemctl start tomcat
sudo systemctl stop tomcat
~~~


### Actual results:

 - The following ClassNotFoundException happens at JreMemoryLeakPreventionListener during the start-up:

~~~
Dec 03, 2018 5:03:13 PM org.apache.catalina.core.JreMemoryLeakPreventionListener lifecycleEvent
SEVERE: Failed to trigger creation of the GC Daemon thread during Tomcat start to prevent possible memory leaks. This is expected on non-Sun JVMs.
java.lang.ClassNotFoundException: sun.misc.GC
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:351)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:388)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:101)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:642)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:667)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427)
~~~

 - The following NoSuchFieldException happens at WebappClassLoaderBase.clearReferencesResourceBundles() for every web application undeployment during the shutdown:

~~~
Dec 03, 2018 5:03:21 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesResourceBundles
SEVERE: Failed to clear ResourceBundle references for web application []
java.lang.NoSuchFieldException: loaderRef
	at java.base/java.lang.Class.getDeclaredField(Class.java:2412)
	at org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesResourceBundles(WebappClassLoaderBase.java:3049)
	at org.apache.catalina.loader.WebappClassLoaderBase.clearReferences(WebappClassLoaderBase.java:2255)
	at org.apache.catalina.loader.WebappClassLoaderBase.stop(WebappClassLoaderBase.java:2123)
	at org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:663)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5872)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1587)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1576)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
~~~


### Expected results:

No exception happens at the start-up and shutdown.


### Additional info:

I think the following fixes are related to these exceptions. These fix have been incorporated in 7.0.83 onwards in the community versions of Tomcat 7. As far as I tested with the community distributions, these exceptions do not occur on tomcat 7.0.84 and the latest tomcat 7.0.92. It looks that other changes also can be related to Java 9+ support, so it may be better to rebase the tomcat version than cherry-picking the specific change.

 - TheJava 9 has fixed some more memory leaks. · apache/tomcat70@8073fcc
   github: https://github.com/apache/tomcat70/commit/8073fcc9660059ad60ec77cab492bfbc40fcb92d
   SVN:  https://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk@1810335

 - Remove the ResourceBundle memory leak protection since I am as sure a… · apache/tomcat70@de778e1
   github: https://github.com/apache/tomcat70/commit/de778e12a12e3e37cf0ca8d98c1500bf21e67755
   SVN: https://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk@1812512

Comment 3 RHEL Program Management 2019-03-05 14:41:29 UTC
Quality Engineering Management has reviewed and declined this request. You may appeal this decision by reopening this request.


Note You need to log in before you can comment on or make changes to this bug.