解决:NoClassDefFoundError: org/apache/http/ssl/SSLContexts

原文:https://blog.csdn.net/xiehuanhuan1991/article/details/79914581?utm_source=blogxgwz0

之前做微信网页授权时,要访问他的url,于是要有httpclient

CloseableHttpClient client = HttpClientBuilder.create().build();

但是运行时tomcat报错NoClassDefFoundError: org/apache/http/ssl/SSLContexts
解决办法引入依赖:


      org.apache.httpcomponents
      httpcore
      4.4
    

    
      org.apache.httpcomponents
      httpclient
      4.5.2
    

这里要注意httpcore一定要4.4及以上版本的。

你可能感兴趣的:(Java编程语言)