gateway转发报错
来源:2-9 项目架构与微服务搭建
顾文龙
2021-08-24
2100-01-01 13:14:00.666 [reactor-http-nio-2] INFO com.netflix.config.ChainedDynamicProperty - Flipping property: ms-diners.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2100-01-01 13:14:00.666 [reactor-http-nio-2] WARN o.s.c.a.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘ribbonLoadBalancingHttpClient’ defined in org.springframework.cloud.netflix.ribbon.apache.HttpClientRibbonConfiguration: Unsatisfied dependency expressed through method ‘ribbonLoadBalancingHttpClient’ parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘ribbonLoadBalancer’ defined in org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.loadbalancer.ILoadBalancer]: Factory method ‘ribbonLoadBalancer’ threw exception; nested exception is java.lang.NoClassDefFoundError: com/netflix/util/concurrent/ShutdownEnabledTimer
2100-01-01 13:14:00.666 [reactor-http-nio-2] ERROR o.s.b.a.w.r.error.AbstractErrorWebExceptionHandler - [3c00e303-3] 500 Server Error for HTTP GET "/hello?name=redis"
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘ribbonLoadBalancingHttpClient’ defined in org.springframework.cloud.netflix.ribbon.apache.HttpClientRibbonConfiguration: Unsatisfied dependency expressed through method ‘ribbonLoadBalancingHttpClient’ parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘ribbonLoadBalancer’ defined in org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.loadbalancer.ILoadBalancer]: Factory method ‘ribbonLoadBalancer’ threw exception; nested exception is java.lang.NoClassDefFoundError: com/netflix/util/concurrent/ShutdownEnabledTimer
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:797) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
|_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ HTTP GET “/hello?name=redis” [ExceptionHandlingWebHandler]
配置文件
server:
port: 80
spring:
application:
name: ms-gateway
cloud:
gateway:
discovery:
locator:
enabled: true # 开启配置注册中心进行路由功能
lower-case-service-id: true # 将服务名称转小写
routes:
- id: ms-diners
uri: lb://ms-diners
predicates:
- Path=/hello/**
eureka:
instance:
prefer-ip-address: true
instance-id: spring.cloud.client.ip−address:{spring.cloud.client.ip-address}:spring.cloud.client.ip−address:{server.port}
client:
service-url:
defaultZone: http://localhost:8080/eureka/
1回答
-
InCowboy
2021-08-26
你检查一下你的/hello?name=redis这个接口能不能访问呢,看日志是这里面500错误了
032021-08-26
相似问题