java.lang.NoClassDefFoundError: org/apache/http/conn/scheme/SchemeSocketFactory

前端 未结 5 587
走了就别回头了
走了就别回头了 2021-01-02 21:16

I am tring to send mail by AWSCredentials but getting an exception

java.lang.NoClassDefFoundError: org/apache/http/conn/scheme/SchemeSocketFactory

相关标签:
5条回答
  • 2021-01-02 21:49

    From the javadoc, it seems that the org/apache/http/conn/scheme/SchemeSocketFactory class exists since the 4.1 version.

    So, try to upgrade httpclient jar to at least 4.1 version.

    0 讨论(0)
  • 2021-01-02 21:50

    In my case, I had two libraries that I created in Netbeans 7.2: one for the Apache Commons Codec 1.6, and one for the Apache Commons HttpClient 4.2.2. In this case, because the library I made for HttpClient also contained the Codec 1.6 jar, I was getting this same error.

    Be sure you don't have two of the same libraries referenced in your class path, or two conflicting versions of the same library.

    0 讨论(0)
  • 2021-01-02 21:52

    From the javadocs, the SchemeSocketFactory class is only available since version 4.1. So this might have something to do with the fact that you are using the 4.0 alpha jars. Try upgrading your http-client library to 4.1 or higher.

    0 讨论(0)
  • 2021-01-02 21:52

    debug your code and point out where Exception occur. Any of instance of class that you used is not included in your jar file i think so. am not sure. find that by debugging. i think SchemeSocketFactory is not exsisting in your class path. please check

    0 讨论(0)
  • 2021-01-02 22:04

    If you download the latest aws java SDK (I just downloaded aws-java-sdk-1.9.3),

    the required libraries will be in the third-party/**/lib folders. There are a bunch of them!

    This answer from jomofrodo needs more atention. Nailed it. Thanks!

    0 讨论(0)
提交回复
热议问题