. lang。NoClassDefFoundError:org/apache/http/nio/conn/NHttpClientConnectionManager

时间:2021-04-20 15:36:30

I currently have these jars:

我现在有这些罐子:

  • httpasyncclient-4.0-beta3.jar
  • httpasyncclient beta3.jar——4.0
  • httpclient-4.5.jar
  • httpclient-4.5.jar
  • httpclient-cache-4.5.jar
  • httpclient-cache-4.5.jar
  • httpclient-win-4.5.jar
  • httpclient-win-4.5.jar
  • httpcore-4.3.jar
  • httpcore-4.3.jar
  • httpcore-nio-4.1-beta2.jar
  • httpcore beta2.jar——nio - 4.1
  • httpmime-4.2.3.jar
  • httpmime-4.2.3.jar
  • slf4j-api-1.7.12.jar
  • slf4j-api-1.7.12.jar

My java method where the error comes from is:

我的java方法错误来自于:

 private HttpResponse<JsonNode> jwtAuthPost(String assertion) throws UnirestException {
    HttpResponse<JsonNode> jsonResponse = Unirest.post(AUTH_URL)
              .header("accept", "application/json")
              .field("grant_type", JWT_GRANT_TYPE)
              .field("client_id", this.clientId)
              .field("client_secret", this.clientSecret)
              .field("assertion", assertion)
              .asJson();  //error here

    return jsonResponse;
}

I'm guessing there is a plugin somewhere that I'm missing for this, but I can't seem to find it anywhere.

我猜有一个插件,我找不到它,但我找不到它。

Rest of Error Log

其他错误日志

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/nio/conn/NHttpClientConnectionManager
  at com.mashape.unirest.http.HttpClientHelper.prepareRequest(HttpClientHelper.java:154)
  at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:134)
  at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)

1 个解决方案

#1


1  

Include

包括

httpasyncclient-4.0-beta4.jar

httpasyncclient beta4.jar——4.0

instead of

而不是

httpasyncclient-4.0-beta3.jar

httpasyncclient beta3.jar——4.0

See: http://www.java2s.com/Code/Jar/h/Downloadhttpasyncclient40beta4jar.htm

参见:http://www.java2s.com/Code/Jar/h/Downloadhttpasyncclient40beta4jar.htm

#1


1  

Include

包括

httpasyncclient-4.0-beta4.jar

httpasyncclient beta4.jar——4.0

instead of

而不是

httpasyncclient-4.0-beta3.jar

httpasyncclient beta3.jar——4.0

See: http://www.java2s.com/Code/Jar/h/Downloadhttpasyncclient40beta4jar.htm

参见:http://www.java2s.com/Code/Jar/h/Downloadhttpasyncclient40beta4jar.htm