The class file for org.apache.http.annotation.notthreadsafe could not be found
Problem phenomenon
Recently, when calling the get request function containing the request body, httpclient-4.5.2.jar and httpcore-4.4.5.jar were referenced.
The following errors are reported during project compilation:
Cause analysis
The versions of HttpCore and httpclient do not match
Solution
Change the version of HttpCore from 4.4.5 to 4.4.4. Maven refers to the following:
<dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.2</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> <version>4.4.4</version> </dependency>
Similar Posts:
- [Solved] SparkSQL Error: org.apache.hadoop.security.HadoopKerberosName.setRuleMechanism
- Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]
- [Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0
- [Solved] Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses
- [Solved] Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses
- [Solved] SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
- Springboot always reports an error when importing JSP dependencies
- SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path
- [Solved] Jsonobject has no from object, idea has no Maven dependency, jsonobject Maven dependency package
- Maven no main manifest attribute when generate jar for project