question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Updating to Java 11 causes vault to to not find reactor.netty.http.client.HttpClient

See original GitHub issue

Working project with Java 10, tested with 2.0.5.RELEASE, 2.0.6.RELEASE and 2.1.0.M4 with Spring Cloud Finchley.SR1 and Greenwich.M1. Project works and runs as expected.

Changing only the Java version from 10 to 11 gives the error of

	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:303)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:284)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1307)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1153)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:848)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:865)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:548)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:797)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:421)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:340)
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:197)
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:104)
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:70)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75)
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:371)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:330)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1279)
	at com.chg.documentservice.DocumentServiceApplication.main(DocumentServiceApplication.java:10)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration$$EnhancerBySpringCGLIB$$99154ba1]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: reactor/netty/http/client/HttpClient
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:184)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:299)
	... 30 common frames omitted
Caused by: java.lang.NoClassDefFoundError: reactor/netty/http/client/HttpClient
	at org.springframework.vault.config.ClientHttpConnectorFactory.create(ClientHttpConnectorFactory.java:54)
	at org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration.createConnector(VaultReactiveBootstrapConfiguration.java:105)
	at org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration.<init>(VaultReactiveBootstrapConfiguration.java:86)
	at org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration$$EnhancerBySpringCGLIB$$99154ba1.<init>(<generated>)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)
	... 32 common frames omitted
Caused by: java.lang.ClassNotFoundException: reactor.netty.http.client.HttpClient
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 41 common frames omitted

This is not a Webflux project. I understand Java 11 removed certain classes from the JDK, but these are not the classes that were removed.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
mp911decommented, Nov 27, 2018

Thanks a lot for bringing up the point of a changed Java release schedule. The new release schedule is a challenge on its own. We have here a project that has a quite long dependency chain:

  1. Spring Framework is required by all Spring projects as a foundation to be released first as it is required to support a new Java release first.
  2. Spring Vault needs to catch up if required.
  3. Since Spring Cloud builds on top of Spring Boot, we need a Spring Boot release that picks up Spring Framework for the new Java release
  4. Spring Cloud is required to ship a release.

Releases tend to happen in somewhat regular intervals of about a month in between. Let me take this issue to our team to see whether we can improve.

1reaction
mp911decommented, Oct 29, 2018

Thanks a lot. I was able to reproduce the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

After upgrading spring-boot from 2.3.5.RELEASE to 2.4.0 ...
I could find out this information on IntelliJ by inspecting the origin of the imported class reactor.netty.http.client.HttpClient , which works ...
Read more >
HttpClient (reactor-netty 1.1.1)
An HttpClient allows building in a safe immutable way an http client that is materialized and connecting when ClientTransport.connect() is ultimately called ...
Read more >
Spring Cloud Sleuth customization
We decorate the Kafka clients ( KafkaProducer and KafkaConsumer ) to create a span for each event that is produced or consumed. You...
Read more >
pact-jvm
I'm looking at https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-provider-junit#example-of-http-test specifically the `toStateWithData(Map data)` method.
Read more >
reactor/reactor-netty - Gitter
Hi, I need to be able to take differing actions based on whether or not the client receives the HTTP response. We provide...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found