2

I am running my java application with java 9 and tomcat 7.0.73 and I am getting following in my catalina.out file.

  • Is there any work around to avoid it?
  • Can you please help me understand the impact of this error. My application is coming up properly.
  • Also why GC daemon thread is created during tomcat startup, is it configurable?

Here is error in catalina.out file.

Mar 10, 2018 2:09:39 AM 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:466)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:292)
        at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:324)
        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:564)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427)

I am using official oracle jdk

/usr/local/java/jdk9/bin/java --version
java 9.0.4
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
learner
  • 1,952
  • 7
  • 33
  • 62
  • Are you using official Oracle JDK? – DeadSpock Mar 21 '18 at 06:07
  • yes I am using official oracle jdk – learner Mar 21 '18 at 06:18
  • Use a newer tomcat or an older Java. – Henry Mar 21 '18 at 06:24
  • Can you please help me understand the impact of this. My application is coming up properly. Also do you know why GC daemon thread is created during tomcat startup – learner Mar 21 '18 at 06:43
  • Judging by the error message "This is expected on non-Sun JVMs" it probably has little impact. – Henry Mar 21 '18 at 06:51
  • 1
    `sun.misc.GC` was a JDK internal class in older releases, it no longer exists. Tomcat should not be be trying to use this directly. Have you tried a newer version of Tomcat? I thought Tomcat 9 was needed to run on JDK 9 or newer. – Alan Bateman Mar 21 '18 at 07:41
  • I second the above and previously [made a comment](https://stackoverflow.com/questions/45917401/tomcat-7-0-73-doesnt-work-with-java-9#comment78793450_45917401) to [this question](https://stackoverflow.com/questions/45917401/tomcat-7-0-73-doesnt-work-with-java-9) from you as well. – Naman Mar 21 '18 at 08:53
  • if my application in production is loaded once, i.e., on startup, do I need to worry about this issue? – learner Mar 22 '18 at 10:22

1 Answers1

0

For me the solution was: The JRE I used for the tomcat wasn't the right one.

  • Double click on the server
  • Runtime Environment
  • Choose the right JRE
ur86
  • 43
  • 6