2

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.

Cayman_h
  • 31
  • 1
  • It looks like the Spring Boot app is stopped. Did you try restarting it? – clav Nov 13 '19 at 15:48
  • After restart it works properly, but for a couple of days. Then the application needs the next restart because Scheduler is not working. I don't want to restart it once a week. – Cayman_h Nov 13 '19 at 15:57
  • I don't think it needs a restart because the scheduler isn't working, it looks to me like the scheduler isn't working because your app stops running. Perhaps you can find something in the logs that indicates why the app stops running? – clav Nov 13 '19 at 16:12
  • you can use quartz http://www.quartz-scheduler.org/ – ozkanpakdil Nov 17 '19 at 09:14

0 Answers0