These are chat archives for spring-cloud/spring-cloud

13th
Feb 2019
Juan Antonio Breña Moral
@jabrena
Feb 13 08:32
Good morning @trajano, what example do you think that it is typical in any engineer who move from Spring MVC to WebFlux mixing Blocking and Non Blocking?
matin-reza
@matin-reza
Feb 13 09:53
Hi to all
This my repo
The current version of spring boot is 2.0.4.release
When I upgrade the version to 2.1.1-release, the gateway app are not able to run and the following exception is raised

``
The bean 'scopedTarget.oauth2ClientContext', defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2RestOperationsConfiguration$SessionScopedConfiguration$ClientContextConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/security/oauth2/config/annotation/web/configuration/OAuth2ClientConfiguration$OAuth2ClientContextConfiguration.class] and overriding is disabled.

Action:

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

Process finished with exit code 1
``

Where is wrong?
and How do I fix it?
jerryniu
@geercode
Feb 13 10:00
springboot version 2.0.x is not compatible with 2.1.x
Olga Maciaszek-Sharma
@OlgaMaciaszek
Feb 13 10:01
@matin-reza you would have to upgrade to Greenwich Spring Cloud Release Train in order to use boot 2.1
jerryniu
@geercode
Feb 13 10:01
oauth2 is a same issue
Olga Maciaszek-Sharma
@OlgaMaciaszek
Feb 13 10:01
you are using Spring Cloud Finchley. You would have to upgrade it to Greenwich
jerryniu
@geercode
Feb 13 10:02
check the version of oauth2 in the springcloud G management
@OlgaMaciaszek what time it is in your timezone?
(:
Olga Maciaszek-Sharma
@OlgaMaciaszek
Feb 13 10:09
11.08 am; why @geercode ?
jerryniu
@geercode
Feb 13 10:10
irrelevant.I did expect a very late time in a day……
chinese coder is working late all the time
matin-reza
@matin-reza
Feb 13 10:11
@OlgaMaciaszek When I have upgraded the zuul version from Finchley.RELEASE to Greenwich.RELEASE, the dependency of @EnableOAuth2Sso is not detected
matin-reza
@matin-reza
Feb 13 10:16
@OlgaMaciaszek Am I right?
@OlgaMaciaszek I think the following dependency is not compatible with Greenwch
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-oauth2</artifactId> </dependency>
jerryniu
@geercode
Feb 13 10:21
I think you should upgrade your oauth2 package to the latest version
matin-reza
@matin-reza
Feb 13 10:21
@geercode What is the latest version?
jerryniu
@geercode
Feb 13 10:22
image.png
2.3.4
springsecurity is not in the management of springcloud
it's in the bom of spring security I suppose
you should use that
Olga Maciaszek-Sharma
@OlgaMaciaszek
Feb 13 10:31
@matin-reza if you update the gateway pom like so, <spring-cloud.version>Greenwich.RELEASE</spring-cloud.version> you should get the org.springframework.cloud:spring-cloud-starter-oauth2:jar:2.1.0.RELEASE dependency, which brings along org.springframework.cloud:spring-cloud-starter-security:jar:2.1.0.RELEASE, which, in turn provides org.springframework.security.oauth:spring-security-oauth2:jar:2.3.3.RELEASE; I've done the change locally, rebuilt it and run from IDE, and have not had any issues with the oAuth annotation; if it still does not work for you, please push the changed code on a branch.
jerryniu
@geercode
Feb 13 10:33
if the annotation @EnableOAuth2Sso is supported,which is big chance the case,I think it's something happens with your IDE
you should restart it to give another shot.
Olga Maciaszek-Sharma
@OlgaMaciaszek
Feb 13 10:35
:+1:
or refresh/ rebuild using the IDE
matin-reza
@matin-reza
Feb 13 10:36
I am doing...
@OlgaMaciaszek You wouldn't change the <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-oauth2</artifactId> </dependency>????
matin-reza
@matin-reza
Feb 13 10:41
Or you add the <version>2.3.3.RELEASE</version>?
jerryniu
@geercode
Feb 13 10:41
dont need to actually
matin-reza
@matin-reza
Feb 13 10:41
Why my problem is not fixedddddddddddddddddd?
jerryniu
@geercode
Feb 13 10:41
some complex pom would need
matin-reza
@matin-reza
Feb 13 10:42
I have changed only Greenwich version
really
jerryniu
@geercode
Feb 13 10:43
some bug happens...
try use mvn clean install.use console neatly
if the problem is still there you could try dependency tree to analysis it.