[英]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.