java.lang.NoClassDefFoundError: org/apache/http/params/SyncBasicHttpParams

之前项目一直报如下错误:

 

java.lang.NoClassDefFoundError: org/apache/http/params/SyncBasicHttpParams

 排查了3个小时,发现项目中同时引用了httpClient 相关的jar包的 4.1.2 和 4.0.1版本,而SyncBasicHttpParams是从4.1才开始有的,所以版本很重要啊

附上httpClient的maven配置:

 

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.1.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient-cache</artifactId>
			<version>4.1.2</version>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpmime</artifactId>
			<version>4.1.2</version>
		</dependency>

你可能感兴趣的:(java.lang.NoClassDefFoundError: org/apache/http/params/SyncBasicHttpParams)