小编Cal*_*e W的帖子

Spring Boot 2.6 回归:如何修复适配器中的 Keycloak 循环依赖?

Spring Boot 2.6.x 似乎引入了一些更改,导致之前与 Keycloak 的集成出现循环引用,从而阻止应用程序启动;它可以在当前的 2.5.x 版本中正常工作并启动。

\n

明确地说,通过在spring-boot-starter-parent中将<version> 标记值从 2.5.7 更改为 2.6.1 之外的任何内容,都会出现下面详细说明的错误/消息。

\n

当然,预期的行为是应用程序正常启动,并且像以前一样使用 Keycloak 进行保护。

\n

实际的消息是:

\n
***************************\nAPPLICATION FAILED TO START\n***************************\n\nDescription:\n\nThe dependencies of some of the beans in the application context form a cycle:\n\n\xe2\x94\x8c\xe2\x94\x80\xe2\x94\x80->\xe2\x94\x80\xe2\x94\x80\xe2\x94\x90\n|  keycloakSecurityConfig (field private org.keycloak.adapters.KeycloakConfigResolver org.keycloak.adapters.springsecurity.config.KeycloakWebSecurityConfigurerAdapter.keycloakConfigResolver)\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80<-\xe2\x94\x80\xe2\x94\x80\xe2\x94\x98\n
Run Code Online (Sandbox Code Playgroud)\n

完整的堆栈跟踪:

\n
2021-11-30 12:49:07.308 DEBUG 7 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : Application failed to start due to an exception\n\norg.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name \'keycloakSecurityConfig\': Requested bean is currently in creation: Is …
Run Code Online (Sandbox Code Playgroud)

java spring spring-security spring-boot keycloak

45
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×1

keycloak ×1

spring ×1

spring-boot ×1

spring-security ×1