卡卡5 2022-04-10 18:09 采纳率: 63.6%
浏览 191
已结题

项目的springboot模块启动不了 看报错是bean的命名问题 但是再配置文件已经做了相关配置按道理来讲不会出现这个问题

2022-04-10 17:55:47.857 INFO [,,,] 30452 --- [ main] com.pazl.css.sort.SortApplication : The following profiles are active: dev
2022-04-10 17:55:51.158 WARN [,,,] 30452 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'aflm-common-auth.FeignClientSpecification' defined in null: Cannot register bean definition [Generic bean: class [org.springframework.cloud.openfeign.FeignClientSpecification]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'aflm-common-auth.FeignClientSpecification': There is already [Generic bean: class [org.springframework.cloud.openfeign.FeignClientSpecification]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.
2022-04-10 17:55:51.179 INFO [,,,] 30452 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-04-10 17:55:51.222 ERROR [,,,] 30452 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

The bean 'aflm-common-auth.FeignClientSpecification' could not be registered. A bean with that name has already been defined and overriding is disabled.

Action:

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

Disconnected from the target VM, address: '127.0.0.1:11444', transport: 'socket'

Process finished with exit code 1

  • 写回答

2条回答 默认 最新

  • CSDN专家-sinJack 2022-04-10 19:03
    关注

    bean已经存在了,不能重复注册。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 8月26日
  • 已采纳回答 8月18日
  • 创建了问题 4月10日