carnellj / spmia-chapter7

Source code for chapter 7 of Spring Microservices in Action
46 stars 133 forks source link

There is more than one bean of 'OAuth2ClientContext' type #8

Closed zhenyanghua closed 7 years ago

zhenyanghua commented 7 years ago

My IDE keeps prompting this error, how to resolve it?

screen shot 2017-09-06 at 10 47 56 am

carnellj commented 7 years ago

Hi Zhenyang,

Sorry I did not get back to you sooner as I have been tied up. I have not see this error before, but I have been using Intellij not eclipse. I'll dig into it in the next couple of days and see if I can resolve it. Usually when you run into this error, the Spring Framework has found 2 bean definitions for the same type and can not resolve it. Usually, once you find the conflict you have to mark as primary the bean definition that you want to use.

 Thanks,
      John

On Wed, Sep 6, 2017 at 10:51 AM, Zhenyang Hua notifications@github.com wrote:

My IDE keeps prompting this error, how to resolve it?

[image: screen shot 2017-09-06 at 10 47 56 am] https://user-images.githubusercontent.com/6165894/30118428-089f818c-92f1-11e7-9004-c9efd68444d5.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/carnellj/spmia-chapter7/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AAduZYLeOgt76k2uI7t3vGQyZTAx9Hh5ks5sfrFWgaJpZM4POfyP .

zhenyanghua commented 7 years ago

Hi John,

This error goes away after switching to the feature branch so I closed it but it remains in the master branch.

Thanks for the tip.

Zhenyang

pedrumJSAS commented 6 years ago

Just to confirm I am having the same issue. I'm having the issue on intellij. I've followed the tutorial below:

https://spring.io/guides/tutorials/spring-boot-oauth2/

starrybleu commented 6 years ago

Same here. Is it resolved? image

manoj7shekhawat commented 6 years ago

You can use @Qualifier to resolve this. @Qualifier("oAuth2ClientContext")