SpringBoot遇到一个诡异的bug,每次停止项目的时候报错,求大佬指点
Disconnected from the target VM, address: '127.0.0.1:49987', transport: 'socket'
2021-05-22 22:36:34.077 INFO 38235 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-05-22 22:36:35.449 INFO 38235 --- [tor-Framework-0] o.a.c.f.imps.CuratorFrameworkImpl : backgroundOperationsLoop exiting
2021-05-22 22:36:35.490 INFO 38235 --- [ain-EventThread] org.apache.zookeeper.ClientCnxn : EventThread shut down for session: 0x1000000a7da6620
2021-05-22 22:36:35.490 INFO 38235 --- [extShutdownHook] org.apache.zookeeper.ZooKeeper : Session: 0x1000000a7da6620 closed
2021-05-22 22:36:35.493 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-3} closing ...
2021-05-22 22:36:35.506 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-3} closed
2021-05-22 22:36:35.506 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-4} closing ...
2021-05-22 22:36:35.510 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-4} closed
2021-05-22 22:36:35.512 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-4} closing ...
2021-05-22 22:36:35.512 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-3} closing ...
2021-05-22 22:36:35.512 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-2} closing ...
2021-05-22 22:36:35.513 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-2} closed
2021-05-22 22:36:35.513 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closing ...
2021-05-22 22:36:35.514 INFO 38235 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed
2021-05-22 22:36:35.518 WARN 38235 --- [extShutdownHook] s.c.a.AnnotationConfigApplicationContext : Exception thrown from ApplicationListener handling ContextClosedEvent
org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'sqlSessionFactoryOpen': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:208)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
at org.springframework.context.event.AbstractApplicationEventMulticaster.retrieveApplicationListeners(AbstractApplicationEventMulticaster.java:245)
at org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:197)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:134)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:409)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1012)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:978)
at org.springframework.cloud.context.named.NamedContextFactory.destroy(NamedContextFactory.java:92)
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:258)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:571)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:543)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1075)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:504)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1068)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1060)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1029)
at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:948)
2021-05-22 22:36:35.519 WARN 38235 --- [extShutdownHook] s.c.a.AnnotationConfigApplicationContext : Exception thrown from ApplicationListener handling ContextClosedEvent
Process finished with exit code 130 (interrupted by signal 2: SIGINT)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看着应该是,sqlSessionFactoryOpen 创建的过程中就停止了
应该是在代码的某处对
ApplicationContext
做了关闭动作,导致调用了DefaultSingletonBeanRegistry#destroySingletons
,singletonsCurrentlyInDestruction
设置为true。然后在getSingleton
的时候被检测到,抛出了异常。@see AbstractApplicationContext#close()
@see AbstractApplicationContext#destroyBeans()
在关闭的时候调用了
BeanFactory#getBean()
操作,应该检查下destroy
相关方法的准确性。