类无法注册
来源:16-2 升级到2.1.1
向往平凡却不甘于平凡
2019-06-04
升级到2.1.1后莫名
2019-06-04 10:20:27,017 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name ‘wxMpConfigStorage’ defined in class path resource [com/imooc/config/WechatOpenConfig.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=wechatOpenConfig; factoryMethodName=wxMpConfigStorage; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/imooc/config/WechatOpenConfig.class]] for bean ‘wxMpConfigStorage’: There is already [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=wechatMpConfig; factoryMethodName=wxMpConfigStorage; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/imooc/config/WechatMpConfig.class]] bound.
2019-06-04 10:20:27,026 -
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
The bean ‘wxMpConfigStorage’, defined in class path resource [com/imooc/config/WechatOpenConfig.class], could not be registered. A bean with that name has already been defined in class path resource [com/imooc/config/WechatMpConfig.class] and overriding is disabled.
微信开放平台的配置文件无法注册了
2回答
-
向往平凡却不甘于平凡
提问者
2019-06-04
2019-06-04 10:20:27,017 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name ‘wxMpConfigStorage’ defined in class path resource [com/imooc/config/WechatOpenConfig.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=wechatOpenConfig; factoryMethodName=wxMpConfigStorage; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/imooc/config/WechatOpenConfig.class]] for bean ‘wxMpConfigStorage’: There is already [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=wechatMpConfig; factoryMethodName=wxMpConfigStorage; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/imooc/config/WechatMpConfig.class]] bound. 2019-06-04 10:20:27,026 - Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled. The bean ‘wxMpConfigStorage’, defined in class path resource [com/imooc/config/WechatOpenConfig.class], could not be registered. A bean with that name has already been defined in class path resource [com/imooc/config/WechatMpConfig.class] and overriding is disabled.
微信开放平台WechatMpConfig这个配置文件无法注册,没升级前 项目可以跑起来的,
022019-06-04 -
廖师兄
2019-06-04
日志格式化一下,否则没法看。你检查是不是忘记加@Bean了,对比我的源码
00
相似问题