我在Tomcat上部署的Spring Boot中的应用程序有问题。
几天(约7天)后,Spring Scheduler停止工作。我在日志中发现以下异常:
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中发布了一个错误。似乎该错误已在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,但是现在说它是否可以解决问题还为时过早。