java.lang.NoClassDefFoundError:io / netty / handler / ssl / SslContextBuilder [英] java.lang.NoClassDefFoundError: io/netty/handler/ssl/SslContextBuilder
本文介绍了java.lang.NoClassDefFoundError:io / netty / handler / ssl / SslContextBuilder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试实施
更新
我将我的依赖关系更新为:
< ;依赖性>
< groupId> com.turo< / groupId>
< artifactId> pushy< / artifactId>
< version> 0.10< / version>
< / dependency>
< dependency>
< groupId> io.netty< / groupId>
< artifactId> netty-all< / artifactId>
< version> 4.1.11.Final< / version>
< / dependency>
< dependency>
< groupId> io.netty< / groupId>
< artifactId> netty-tcnative< / artifactId>
< version> 2.0.1.Final< / version>
< / dependency>
< dependency>
< groupId> com.google.code.gson< / groupId>
< artifactId> gson< / artifactId>
< version> 2.6< / version>
< / dependency>
但现在得到:
Jun 28,2017 2:40:18 PM com.turo.pushy.apns.SslUtil getSslProvider
INFO:原生SSL提供商不可用;将使用JDK SSL提供程序。
线程main中的异常java.lang.NoSuchMethodError:io.netty.bootstrap.Bootstrap.config()Lio / netty / bootstrap / BootstrapConfig;
at com.turo.pushy.apns.ApnsClient。< init>(ApnsClient.java:172)
at com.turo.pushy.apns.ApnsClientBuilder.build(ApnsClientBuilder.java:420)
at com.jobs.spring.service.NotificationServiceImpl.sendIOSPushNotification(NotificationServiceImpl.java:121)
解决方案
好像你混合了netty 4.1和4.0。如果你想使用pushy,你只需要使用4.1。
I am trying to implement relayrides/pushy, but am getting the following runtime error:
Jun 28, 2017 2:06:58 PM com.turo.pushy.apns.SslUtil getSslProvider INFO: Native SSL provider not available; will use JDK SSL provider. Exception in thread "main" java.lang.NoClassDefFoundError: io/netty/handler/ssl/SslContextBuilder at com.turo.pushy.apns.ApnsClientBuilder.build(ApnsClientBuilder.java:396) at com.jobs.spring.service.NotificationServiceImpl.sendIOSPushNotification(NotificationServiceImpl.java:122) Caused by: java.lang.ClassNotFoundException: io.netty.handler.ssl.SslContextBuilder
pom.xml
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<!-- Push Notifications -->
<dependency>
<groupId>com.turo</groupId>
<artifactId>pushy</artifactId>
<version>0.10</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>2.0.5.Final</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.0.27.Final</version>
</dependency>
<dependency>
<groupId>com.ning</groupId>
<artifactId>async-http-client</artifactId>
<version>1.9.40</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.1</version>
</dependency>
java
final ApnsClient apnsClient = new ApnsClientBuilder()
.setClientCredentials(new File(PATH_TO_P12_CERT), CERT_PASSWORD )
.build();
I am guessing my mvn dependencies are incorrect. Any help appreciated.
UPDATE
I updated my dependencies to:
<dependency>
<groupId>com.turo</groupId>
<artifactId>pushy</artifactId>
<version>0.10</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.11.Final</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6</version>
</dependency>
But now get:
Jun 28, 2017 2:40:18 PM com.turo.pushy.apns.SslUtil getSslProvider INFO: Native SSL provider not available; will use JDK SSL provider. Exception in thread "main" java.lang.NoSuchMethodError: io.netty.bootstrap.Bootstrap.config()Lio/netty/bootstrap/BootstrapConfig; at com.turo.pushy.apns.ApnsClient.<init>(ApnsClient.java:172) at com.turo.pushy.apns.ApnsClientBuilder.build(ApnsClientBuilder.java:420) at com.jobs.spring.service.NotificationServiceImpl.sendIOSPushNotification(NotificationServiceImpl.java:121)
解决方案
seems like you mix netty 4.1 and 4.0. You need to only use 4.1 if you want to use pushy.
这篇关于java.lang.NoClassDefFoundError:io / netty / handler / ssl / SslContextBuilder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文