Исправьте классную дорожку вашего приложения, чтобы он содержит единую совместимую версию OAuth2.client.Registration.CliJAVA

Программисты JAVA общаются здесь
Anonymous
Исправьте классную дорожку вашего приложения, чтобы он содержит единую совместимую версию OAuth2.client.Registration.Cli

Сообщение Anonymous »

Я пытаюсь развернуть свое веб -приложение на сервере Tomcat локально, и это очень простое приложение для аутентификации KeyCloak, но я получаю ошибку ниже даже после удаления всех локальных репозиториев в этом пути (.m2 \ Repository \ org \ hibernate) тогда Я сделал MVN Clean Install и попытался снова развернуть < /p>
Сообщение об ошибке: < /p>

Код: Выделить всё

An attempt was made to call a method that does not exist.  The attempt was made from the following location:

org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientPropertiesRegistrationAdapter.getBuilderFromIssuerIfPossible(OAuth2ClientPropertiesRegistrationAdapter.java:83)

The following method did not exist:

org.springframework.security.oauth2.client.registration.ClientRegistrations.fromIssuerLocation(Ljava/lang/String;)Lorg/springframework/security/oauth2/client/registration/ClientRegistration$Builder;

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.security.oauth2.client.registration.ClientRegistrations
< /code>
Вот мой код: < /p>
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter
{
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.anyRequest().authenticated()
.and()
.oauth2Login();
}
}
Обновленный файл POM:

Код: Выделить всё

    
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0

com.baeldung.keycloak
E-Services-Portal
war


org.springframework.boot
spring-boot-starter-parent
2.2.2.RELEASE
  



1.8




org.keycloak.bom
keycloak-adapter-bom
3.3.0.Final
pom
provided






org.springframework.boot
spring-boot-starter-security


org.springframework.boot
spring-boot-starter-web


org.springframework.boot
spring-boot-starter-tomcat
provided


org.springframework.security
spring-security-oauth2-client



org.springframework.boot
spring-boot-starter-test
test


org.junit.vintage
junit-vintage-engine





org.apache.tomcat.embed
tomcat-embed-jasper
provided


javax.servlet
jstl
provided


org.glassfish.web
el-impl
2.2


org.axonframework
axon-spring-boot-starter
3.4





central
Maven Plugin Repository
https://repo.maven.apache.org/maven2
default

false


never








org.apache.maven.plugins
maven-war-plugin
3.2.3

/sample/servlet/container/deploy/directory






Примечание: я использую Spring 2.2.2


Подробнее здесь: https://stackoverflow.com/questions/597 ... e-compatib

Вернуться в «JAVA»