Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ClassCastException: com.netflix.loadbalancer.Server cannot be cast to com.netflix.niws.loadbalancer.DiscoveryEnabledServer #1137

Open
h3xstream opened this issue Nov 16, 2021 · 1 comment

Comments

@h3xstream
Copy link

h3xstream commented Nov 16, 2021

I'm trying to test a basic setup of Zuul and I can't make the sample server work..

2021-11-16 00:45:39,882 WARN  com.netflix.zuul.filters.endpoint.ProxyEndpoint [Salamander-ClientToZuulWorker-0] FAILURE_LOCAL, origin = OriginName{niwsClientName='api', target='api', authority='api'}, origin channel info = 
java.lang.ClassCastException: com.netflix.loadbalancer.Server cannot be cast to com.netflix.niws.loadbalancer.DiscoveryEnabledServer
	at com.netflix.zuul.discovery.DynamicServerResolver.resolve(DynamicServerResolver.java:56) ~[zuul-discovery-2.3.1-SNAPSHOT.jar:2.3.1-SNAPSHOT]
	at com.netflix.zuul.discovery.DynamicServerResolver.resolve(DynamicServerResolver.java:42) ~[zuul-discovery-2.3.1-SNAPSHOT.jar:2.3.1-SNAPSHOT]
	at com.netflix.zuul.netty.connectionpool.DefaultClientChannelManager.acquire(DefaultClientChannelManager.java:328) ~[zuul-core-2.3.1-SNAPSHOT.jar:2.3.1-SNAPSHOT]

I'm probably missing something for my configuration.

My configuration:

zuul.server.port.main=9500

### Load balancing backends without Eureka
eureka.shouldFetchRegistry=false
eureka.validateInstanceId=false
eureka.shouldUseDns=false

api.ribbon.listOfServers=127.0.0.1:9090
api.ribbon.client.NIWSServerListClassName=com.netflix.loadbalancer.ConfigurationBasedServerList
api.ribbon.readTimeout=10000
routes.api.path=/api/**
@h3xstream h3xstream changed the title No servers available FAILURE_ORIGIN_NO_SERVERS / No servers available Nov 16, 2021
@h3xstream h3xstream changed the title FAILURE_ORIGIN_NO_SERVERS / No servers available java.lang.ClassCastException: com.netflix.loadbalancer.Server cannot be cast to com.netflix.niws.loadbalancer.DiscoveryEnabledServer Nov 16, 2021
@argha-c
Copy link
Collaborator

argha-c commented Dec 8, 2021

Please try the workaround suggested here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants