我在 Tomcat 上部署的 Spring Boot 中的应用程序有问题。
几天(约 7 天)后,Spring 调度程序停止工作。我在日志中发现以下异常:
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)
发现有人在io.micrometer的Timer中贴了一个bug。该错误似乎已在 1.0.3 版本中修复。我使用的是 Spring Boot 2.0.4 版本,它依赖于 io.micrometer 1.0.6 版本。
https://github.com/micrometer-metrics/micrometer/issues/516
你能帮我解决这个问题吗?我尝试将 Spring Boot 版本更改为 2.1.0,但现在说是否解决问题还为时过早。