rai*_*pak 2 spring spring-boot spring-boot-admin
我正在关注此博客以试用 Spring-Boot-Admin 应用程序。当我运行应用程序时,它失败并显示以下错误:
Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'adminHandlerMapping' defined in class path resource [de/codecentric/boot/admin/server/config/AdminServerWebConfiguration$ServletRestApiConfirguation.class]:
Invocation of init method failed; nested exception is java.lang.StackOverflowError
Run Code Online (Sandbox Code Playgroud)
我在下面进一步查看并找到以下几行:
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_231]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.2.1.RELEASE.jar:2.2.1.RELEASE]
Caused by: java.lang.StackOverflowError: null
at de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.withPrefix(AdminControllerHandlerMapping.java:48) ~[spring-boot-admin-server-2.1.0.jar:2.1.0]
at de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.registerHandlerMethod(AdminControllerHandlerMapping.java:44) ~[spring-boot-admin-server-2.1.0.jar:2.1.0]
Run Code Online (Sandbox Code Playgroud)
不确定 jars 中是否存在一些循环依赖。请问有什么想法吗?
@the hand of NOD 的评论让我重新审视了我的 pom.xml 文件和博客中提供的 pom.xml 文件
问题出在spring-boot-starter-parent. 本教程使用版本2.1.0.RELEASE而当您从Spring Intializr准备项目时的最新版本是2.2.1.RELEASE
我降级到 2.1.0.RELEASE 并且成功了!使用 2.2.1.RELEASE 有一些依赖项会循环使用spring-boot-admin-starter-server
PS 似乎以代码为中心的团队已经在研究它,并将在 2019 年 11 月 22 日之前发布符合 2.2.0 的版本(https://github.com/codecentric/spring-boot-admin/milestones)
| 归档时间: |
|
| 查看次数: |
2873 次 |
| 最近记录: |