I have a problem with the application in Spring Boot deployed on the Tomcat.
After a couple of days (~7 days) the Spring scheduler is stopping working. I have found in logs following exception:
11-Oct-2019 10:41:20.473 INFO [Service Thread] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [io.micrometer.core.instrument.Timer$1]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [io.micrometer.core.instrument.Timer$1]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1353)
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1341)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1206)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
at io.micrometer.core.instrument.Timer$Builder.<init>(Timer.java:245)
at io.micrometer.core.instrument.Timer.builder(Timer.java:51)
at io.micrometer.core.instrument.binder.jvm.JvmGcMetrics.lambda$bindTo$0(JvmGcMetrics.java:150)
at sun.management.NotificationEmitterSupport.sendNotification(NotificationEmitterSupport.java:156)
at sun.management.GarbageCollectorImpl.createGCNotification(GarbageCollectorImpl.java:143)
I found that someone posted a bug in the Timer of io.micrometer. It seems that the bug is fixed in version 1.0.3. I'm using the Spring Boot 2.0.4 version, which has a dependency on the io.micrometer 1.0.6 version.
https://github.com/micrometer-metrics/micrometer/issues/516
Could you please help me with the issue? I tried to change the Spring Boot version to 2.1.0, but it is too early to say if it solves the problem.