Unable to run Zuul2 Sample in local mmachine
DevArunLingala opened this issue · 1 comments
DevArunLingala commented
Gotten the following error when I did gradle run
1) [Guice/ErrorInjectingConstructor]: RuntimeException: Failed to initialize DiscoveryClient!
at DiscoveryClient.<init>(DiscoveryClient.java:321)
at DiscoveryClient.class(DiscoveryClient.java:115)
while locating DiscoveryClient
at EurekaModule.configure(EurekaModule.java:39)
\_ installed by: ZuulSampleModule -> EurekaModule
at SampleServerStartup.<init>(SampleServerStartup.java:84)
\_ for 9th parameter
at SampleServerStartup.class(SampleServerStartup.java:71)
while locating SampleServerStartup
while locating BaseServerStartup
Learn more:
https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR
1 error
======================
Full classname legend:
======================
BaseServerStartup: "com.netflix.zuul.netty.server.BaseServerStartup"
DiscoveryClient: "com.netflix.discovery.DiscoveryClient"
EurekaModule: "com.netflix.discovery.guice.EurekaModule"
SampleServerStartup: "com.netflix.zuul.sample.SampleServerStartup"
ZuulSampleModule: "com.netflix.zuul.sample.ZuulSampleModule"
========================
End of classname legend:
========================
at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1103)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1138)
at com.netflix.zuul.sample.Bootstrap.start(Bootstrap.java:50)
at com.netflix.zuul.sample.Bootstrap.main(Bootstrap.java:38)
Caused by: java.lang.RuntimeException: Failed to initialize DiscoveryClient!
at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:430)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at com.google.inject.internal.DefaultConstructionProxyFactory$ReflectiveProxy.newInstance(DefaultConstructionProxyFactory.java:120)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:60)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:40)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:60)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:60)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1100)
... 3 more
Caused by: java.lang.ExceptionInInitializerError
at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:990)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:593)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:515)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:484)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:430)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:397)
at com.netflix.discovery.converters.XmlXStream.<init>(XmlXStream.java:51)
at com.netflix.discovery.converters.XmlXStream.<clinit>(XmlXStream.java:42)
at com.netflix.discovery.converters.wrappers.CodecWrappers$XStreamXml.<init>(CodecWrappers.java:358)
at com.netflix.discovery.converters.wrappers.CodecWrappers.create(CodecWrappers.java:133)
at com.netflix.discovery.converters.wrappers.CodecWrappers.getEncoder(CodecWrappers.java:75)
at com.netflix.discovery.converters.wrappers.CodecWrappers.getEncoder(CodecWrappers.java:66)
at com.netflix.discovery.provider.DiscoveryJerseyProvider.<init>(DiscoveryJerseyProvider.java:77)
at com.netflix.discovery.shared.transport.jersey.EurekaJerseyClientImpl$EurekaJerseyClientBuilder$MyDefaultApacheHttpClient4Config.<init>(EurekaJerseyClientImpl.java:207)
at com.netflix.discovery.shared.transport.jersey.EurekaJerseyClientImpl$EurekaJerseyClientBuilder.build(EurekaJerseyClientImpl.java:183)
at com.netflix.discovery.shared.transport.jersey.JerseyEurekaHttpClientFactory$JerseyEurekaHttpClientFactoryBuilder.buildLegacy(JerseyEurekaHttpClientFactory.java:230)
at com.netflix.discovery.shared.transport.jersey.JerseyEurekaHttpClientFactory$JerseyEurekaHttpClientFactoryBuilder.build(JerseyEurekaHttpClientFactory.java:204)
at com.netflix.discovery.shared.transport.jersey.JerseyEurekaHttpClientFactory.create(JerseyEurekaHttpClientFactory.java:161)
at com.netflix.discovery.shared.transport.jersey.Jersey1TransportClientFactories.newTransportClientFactory(Jersey1TransportClientFactories.java:59)
at com.netflix.discovery.DiscoveryClient.scheduleServerEndpointTask(DiscoveryClient.java:504)
at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:417)
... 29 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @30c15d8b
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:40)
at com.thoughtworks.xstream.converters.collections.TreeMapConverter.<clinit>(TreeMapConverter.java:50)
... 50 more
###############
Zuul Sample: initialization failed. Forcing shutdown now.
###############
> Task :zuul-sample:run FAILED
DevArunLingala commented
Have run it from wrong directory . so please ignore it.
should do gradle run
from zuul directory NOT zuul/zuul-sample