I have a Microservice application where Gateway is also one of them. As I start the gateway, its not getting started with exception as
`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: Error creating bean with name 'jsonToGRPCFilterFactory' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'jsonToGRPCFilterFactory' parameter 0: Error creating bean with name 'grpcSslConfigurer' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Post-processing of merged bean definition failed
"Caused by: java.lang.NoClassDefFoundError: io/grpc/netty/NettyChannelBuilder
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:465)
... 54 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.grpc.netty.NettyChannelBuilder
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:520)
... 58 common frames omitted`
I have configured one of my supporting microservice as framework. If I am removing dependency of framework I am able to start.
Framework dependencies
- Spring data jpa
- Spring security core
- MySql
- hibernate
Gateway dependency
-Spring cloud gateway
-Spring security
-Framework
As I tried to remove the framework from Gateway dependency its working fine.
Then after commanding all the dependency of framework and readding each and then adding framework dependency to gateway without security also its works.
I required to add security to gateway as well I need framework dependency