求教 Java , springcloud 的 gateway 网关启动报错

2019-12-01 10:23:33 +08:00
 khzl
大佬帮忙看一下,为什么 gateway 网关启动时一直报错 Error creating bean with name 'retryGatewayFilterFactory' defined in class path resource
3399 次点击
所在节点    问与答
10 条回复
khzl
2019-12-01 10:25:54 +08:00
需要哪些细节我后续上传,我感觉报错原因主要是在这里,所以就传了这个报错信息
LangInteger
2019-12-01 11:07:30 +08:00
@khzl 一般 create bean error 只是结果,还会有更深的原因。建议把整个异常堆栈全部 po 上来。
khzl
2019-12-01 12:17:38 +08:00
@LangInteger 抱歉,刚看到
khzl
2019-12-01 12:17:47 +08:00
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'routeDefinitionRouteLocator' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]:
Unsatisfied dependency expressed through method 'routeDefinitionRouteLocator' parameter 1;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'retryGatewayFilterFactory' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException:
Failed to introspect Class [org.springframework.cloud.gateway.filter.factory.RetryGatewayFilterFactory] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
khzl
2019-12-01 12:18:49 +08:00
Caused by: java.lang.NoClassDefFoundError: reactor/retry/Repeat
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_211]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_211]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_211]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:489) ~[spring-core-5.1.6.RELEASE.jar:5.1.6.RELEASE]
... 39 common frames omitted
Caused by: java.lang.ClassNotFoundException: reactor.retry.Repeat
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_211]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_211]
... 43 common frames omitted
LangInteger
2019-12-01 13:46:06 +08:00
还是看不出来原因。如果你闲的话可以把代码推到 github 放个链接,我 pull 下来试试~
harvies
2019-12-01 13:53:08 +08:00
Caused by: java.lang.NoClassDefFoundError: reactor/retry/Repeat 看看是否 jar 宝版本冲突了
khzl
2019-12-01 15:14:08 +08:00
解决了,是 jar 包中文件有缺失,我用镜像下载过来的 jar 包少了一些文件。后面在别人那里考了一个过来,在运行就好了。之前也考过来试了,可能细节没做好还是报错了,所以给忽略了
khzl
2019-12-01 15:14:58 +08:00
感谢各位大佬,哈哈
khzl
2019-12-01 15:17:46 +08:00
感谢各位大佬

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/624732

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX