Seata: HystrixSecurityAutoConfiguration needs to inject the bean at startup, but there are two beans with the same name, how to solve it

Created on 4 Sep 2019  ·  3Comments  ·  Source: seata/seata

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

Field existingConcurrencyStrategy in org.springframework.cloud.netflix.hystrix.security.HystrixSecurityAutoConfiguration required a single bean, but 2 were found:
    - seataHystrixConcurrencyStrategy: defined by method 'seataHystrixConcurrencyStrategy' in class path resource [com/alibaba/cloud/seata/feign/hystrix/SeataHystrixAutoConfiguration.class]
    - sleuthHystrixConcurrencyStrategy: defined by method 'sleuthHystrixConcurrencyStrategy' in class path resource [org/springframework/cloud/sleuth/instrument/hystrix/SleuthHystrixAutoConfiguration.class]

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. xxx
  2. xxx
  3. xxx

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version :
  • OS :
  • Others:
question

Most helpful comment

Just exclude conflicting files in the startup class。
@SpringBootApplication(scanBasePackages = "com.gcyl.pig.shop.*", exclude = {SleuthHystrixAutoConfiguration.class})

All 3 comments

Hi @cwm3412638, we detect non-English characters in the issue. This comment is an auto translation from @fescar-robot to help other users to understand this issue.
We encourage you to describe your issue in English which is more friendly to other users.

HystrixSecurityAutoConfiguration needs to inject the bean at startup, but there are two beans with the same name, how to solve it

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

Field existingConcurrencyStrategy in org.springframework.cloud.netflix.hystrix.security.HystrixSecurityAutoConfiguration required a single bean, but 2 were found:
    - seataHystrixConcurrencyStrategy: defined by method 'seataHystrixConcurrencyStrategy' in class path resource [com/alibaba/cloud/seata/feign/hystrix/SeataHystrixAutoConfiguration.class]
    - sleuthHystrixConcurrencyStrategy: defined by method 'sleuthHystrixConcurrencyStrategy' in class path resource [org/springframework/cloud/sleuth/instrument/hystrix/SleuthHystrixAutoConfiguration.class]

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. xxx
  2. xxx
  3. xxx

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version :
  • OS :
  • Others:

I also encountered the same problem, how to solve

Just exclude conflicting files in the startup class。
@SpringBootApplication(scanBasePackages = "com.gcyl.pig.shop.*", exclude = {SleuthHystrixAutoConfiguration.class})

Was this page helpful?
0 / 5 - 0 ratings