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

Solution Unverified - Updated -

Issue

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

  • 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)

Environment

  • Red Hat Enterprise Linux (RHEL) 7
  • Tomcat 7 running on Java 11 / OpenJDK 11

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In