Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definiti

拼搏现实的明天。 2021-06-10 20:38 2008阅读 0赞
  1. Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  2. 2020-03-10 15:33:32.709 ERROR 5168 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
  3. ***************************
  4. APPLICATION FAILED TO START
  5. ***************************
  6. Description:
  7. The bean 'securityManager', defined in class path resource [org/apache/shiro/spring/config/web/autoconfigure/ShiroWebAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [com/jumpower/shirodemo/config/ShiroConfig.class] and overriding is disabled.
  8. Action:
  9. Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

在这里插入图片描述

  1. 出现原因:注入bean时名字冲突,相同名字不成功

解决方法在application.properties加上

  1. #当遇到同样名字的时候是否覆盖注册
  2. spring.main.allow-bean-definition-overriding=true

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,2008人围观)

还没有评论,来说两句吧...

相关阅读