I use springboot 3.2.4 and jdk21
The following are error messages and minimal examples
I don't know why SpringCloud related processing is happening
2024-04-15T14:12:57.846+08:00 INFO 8680 --- [webflux-demo] [ main] c.l.webfluxdemo.WebfluxDemoApplication : No active profile set, falling back to 1 default profile: "default"
2024-04-15T14:12:59.125+08:00 INFO 8680 --- [webflux-demo] [ main] o.s.b.web.embedded.netty.NettyWebServer : Netty started on port 8080
2024-04-15T14:12:59.130+08:00 INFO 8680 --- [webflux-demo] [ main] c.l.webfluxdemo.WebfluxDemoApplication : Started WebfluxDemoApplication in 1.585 seconds (process running for 2.046)
Exception in thread "Thread-4" java.lang.NoClassDefFoundError: org/springframework/cloud/gateway/route/RouteLocator
at com.cool.request.components.spring.gateway.SpringGatewayComponent.doPush(SpringGatewayComponent.java:41)
at com.cool.request.components.spring.gateway.SpringGatewayComponent.lambda$componentInit$0(SpringGatewayComponent.java:36)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.gateway.route.RouteLocator
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
... 3 more
Comment From: wilkinsona
Thanks for the report. The cause of the problem is in com.cool.request.components.spring.gateway.SpringGatewayComponent which appears to be referring to Spring Cloud Gateway's RouteLocator. The demo does not reproduce the problem as it does not contain SpringGatewayComponent. You should either remove SpringGatewayComponent from your actual app's dependencies or you should add a dependency on Spring Cloud Gateway.
If you have any further questions, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.