简体   繁体   English

java.lang.NoClassDefFoundError:无法初始化类 org.apache.http.conn.ssl.SSLConnectionSocketFactory

[英]java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory

I am facing the following issue :我面临以下问题:

java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory java.lang.NoClassDefFoundError:无法初始化类 org.apache.http.conn.ssl.SSLConnectionSocketFactory

I am using httpclient 4.5 jar.我正在使用 httpclient 4.5 jar。 Could you please let me know how to resolve it?你能告诉我如何解决它吗?

SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, new String[] {"TLSv1" }, null,
                       SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);

my pom.xml contains the following dependency -我的 pom.xml 包含以下依赖项-

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5</version>
    <scope>provided</scope>
</dependency>

I am facing the following issue :我面临以下问题:

java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory java.lang.NoClassDefFoundError:无法初始化类org.apache.http.conn.ssl.SSLConnectionSocketFactory

I am using httpclient 4.5 jar.我正在使用httpclient 4.5 jar。 Could you please let me know how to resolve it?你能让我知道如何解决吗?

SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, new String[] {"TLSv1" }, null,
                       SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);

my pom.xml contains the following dependency -我的pom.xml包含以下依赖项-

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5</version>
    <scope>provided</scope>
</dependency>

We had the same problem with java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory and there was appropriate dependency in Maven.我们在 java.lang.NoClassDefFoundError 中遇到了同样的问题:无法初始化类 org.apache.http.conn.ssl.SSLConnectionSocketFactory 并且在 Maven 中有适当的依赖关系。

The reason of the problem in our case was tika-app, when we changed it to tica-core the problem was solved.在我们的案例中出现问题的原因是 tika-app,当我们将其更改为 tica-core 时,问题就解决了。 The part commented below we replaced with the part above:下面评论的部分我们替换为上面的部分:

    <dependency>
        <groupId>org.apache.tika</groupId>
        <artifactId>tika-core</artifactId>
        <version>1.19.1</version>
    </dependency>

    <!--<dependency>
        <groupId>org.apache.tika</groupId>
        <artifactId>tika-app</artifactId>
        <version>1.16</version>
    </dependency>-->

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 引起:java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory - caused by: java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory java.lang.NoClassDefFoundError: - 不能初始化类org.apache.http.impl.conn.ManagedHttpClientConnectionFactory - java.lang.NoClassDefFoundError :-Could not initialize class org.apache.http.impl.conn.ManagedHttpClientConnectionFactory org.apache.http.conn.ssl上的java.lang.NoClassDefFoundError org / apache / commons / logging / LogFactory - java.lang.NoClassDefFoundError org/apache/commons/logging/LogFactory at org.apache.http.conn.ssl 在HttpClientBuilder.build()中找不到org.apache.http.conn.ssl.SSLConnectionSocketFactory - org.apache.http.conn.ssl.SSLConnectionSocketFactory not found within HttpClientBuilder.build() java.lang.NoClassDefFoundError:org / apache / http / impl / conn / PoolingClientConnectionManager - java.lang.NoClassDefFoundError: org/apache/http/impl/conn/PoolingClientConnectionManager java.lang.NoClassDefFoundError:带有AmazonHttpClient的org / apache / http / conn / SchemePortResolver - java.lang.NoClassDefFoundError: org/apache/http/conn/SchemePortResolver with AmazonHttpClient java.lang.NoClassDefFoundError:org / apache / http / nio / conn / NHttpClientConnectionManager - java.lang.NoClassDefFoundError: org/apache/http/nio/conn/NHttpClientConnectionManager java.lang.NoClassDefFoundError:org / apache / http / conn / params / ConnPerRoute - java.lang.NoClassDefFoundError: org/apache/http/conn/params/ConnPerRoute java.lang.NoClassDefFoundError:org / apache / http / conn / HttpClientConnectionManager - java.lang.NoClassDefFoundError: org/apache/http/conn/HttpClientConnectionManager java.lang.NoClassDefFoundError:org / apache / http / conn / scheme / SchemeSocketFactory - java.lang.NoClassDefFoundError: org/apache/http/conn/scheme/SchemeSocketFactory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM