springboot shutdown has been sto

作者: 黑猫警长1122 | 来源:发表于2018-12-24 13:52 被阅读0次
24-Dec-2018 13:45:39.335 信息 [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8090"]
24-Dec-2018 13:45:39.337 信息 [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
24-Dec-2018 13:45:39.338 信息 [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8090"]
24-Dec-2018 13:45:39.339 信息 [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
24-Dec-2018 13:45:42.487 信息 [Abandoned connection cleanup thread] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load []. 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 []. 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:1311)
    at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:986)
    at com.mysql.jdbc.AbandonedConnectionCleanupThread.checkContextClassLoaders(AbandonedConnectionCleanupThread.java:90)
    at com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:63)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745) 

出现这个问题的原因在于springboot添加了websocket组件,并且配置的时候开启了心跳包,心跳包和springboot定时器是配合使用的,在shutdown的时候tomcat会因为关闭顺序问题报错

registry.enableSimpleBroker("/queue","/topic","/user").setHeartbeatValue(new long[]{10000L, 10000L}).setTaskScheduler(new DefaultManagedTaskScheduler());

去掉心跳包配置即可
registry.enableSimpleBroker("/queue","/topic","/user")

相关文章

网友评论

    本文标题:springboot shutdown has been sto

    本文链接:https://www.haomeiwen.com/subject/koxzkqtx.html