I currently have these jars:
My java method where the error comes from is:
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)
Include
httpasyncclient-4.0-beta 4 .jar
instead of
httpasyncclient-4.0-beta 3 .jar
See: http://www.java2s.com/Code/Jar/h/Downloadhttpasyncclient40beta4jar.htm
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.