Ask Your Question
2

What is causing the runtime error "java.lang.NoClassDefFoundError: org/apache/hc/client5/http/classic/HttpClient" when using SpringBoot 3 along with Spring Cloud Vault 3.1.1?

asked 2022-06-05 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-02-12 05:00:00 +0000

ladyg gravatar image

The runtime error "java.lang.NoClassDefFoundError: org/apache/hc/client5/http/classic/HttpClient" is usually caused when the required class or dependency is missing from the classpath. In this case, it seems like the HttpClient class from the Apache HttpComponents library is missing.

To fix this error, you can try adding the necessary dependency to your project's pom.xml file or gradle.build file. For example, if you're using Maven, you can add the following dependency to your pom.xml file:

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient5</artifactId>
    <version>5.0</version>
</dependency>

If you're using Gradle, you can add the following dependency to your build.gradle file:

implementation 'org.apache.httpcomponents:httpclient5:5.0'

Once you've added the required dependency, rebuild your project and try running it again. This should resolve the NoClassDefFoundError and allow your application to run without issues.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-06-05 11:00:00 +0000

Seen: 13 times

Last updated: Feb 12 '23