rocketmq的优雅停机和 spring getBean 冲突

658648:2016-02-20 18:00:00,hostName=.com,node_error:e:org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'sactionManager': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!),Flag=4e1c5cd12039c856755f3012
659044-org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'payTransactionManager': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
659337- at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:212)
659464- at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
659570- at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
659674- at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:400)
659799- at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:390)
659924- at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:226)
660036- at org.springframework.transaction.interceptor.TransactionAspectUtils.getTransactionManager(TransactionAspectUtils.java:77)
660161- at org.springframework.transaction.interceptor.TransactionAspectUtils.getTransactionManager(TransactionAspectUtils.java:54)
660286- at org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:245)
660422- at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
660533- at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
660643- at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
660736- at com.sun.proxy.$Proxy22.atomChangePayTradeSuccess(Unknown Source)
660805- at com. . . . .biz. .impl.PBizServiceImpl.onlinePayed(PayPayBizServiceImpl.java:293)

660925- at com. .CallBackNode.doService(PayCallBackNode.java:110)

原因解析:

  代理类动态获取bean,会有个判断.

  此时bean的内存关联关系并没有被销毁. 入口没关,代码依然可以执行.

*项目需求链接

    线上问题, 每次重启时,获取bean时大量抛错,具体为如下图:



两者存在竞争,需要在容器关闭之前关闭mq.


*概要设计

    ~涉及外部模块.

    ~各流程模块(主模块,子模块)交互图

流程图



类图



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值