Getting java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/ALPN$Provider

1,022 views
Skip to first unread message

Murali Balusa

unread,
Mar 17, 2017, 4:27:45 PM3/17/17
to pushy
Hi,

I am trying to checkout the pushy to send push notifications to iOS devices. I am trying to run client program in my Eclipse, getting the following error
after this line of code.

final ApnsClient apnsClient = new ApnsClientBuilder()

                .setClientCredentials(new File(certPath), certPwd)

                .build();


java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/ALPN$Provider

at io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator$1.<init>(JdkAlpnApplicationProtocolNegotiator.java:26)

at io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator.<clinit>(JdkAlpnApplicationProtocolNegotiator.java:24)

at io.netty.handler.ssl.JdkSslContext.toNegotiator(JdkSslContext.java:285)

at io.netty.handler.ssl.JdkSslClientContext.<init>(JdkSslClientContext.java:261)

at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:751)

at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:418)

at com.relayrides.pushy.apns.ApnsClientBuilder.build(ApnsClientBuilder.java:430)

at org.kp.apns.ExampleApp.main(ExampleApp.java:42)

Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.alpn.ALPN$Provider

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:358)


I have the following .jars


pushy-0.9.2.jar

gson-2.8.0.jar

slf4j-api-1.7.21.jar

netty-all-4.1.9.Final.jar

jetty-alpn-agent-2.0.1.jar


Do I need to have any other dependent jars ?. Any help is appreciated.

David Feng

unread,
Mar 19, 2017, 11:34:14 PM3/19/17
to pushy
The page can probably solve your problem. If you are using Jetty ALPN implementation.

Murali Balusa

unread,
Mar 20, 2017, 12:26:42 AM3/20/17
to pushy
Hi David,

Do we have to use Jetty ALPN or any other alternatives ?.

Thanks & Regards,
Murali

David Feng

unread,
Mar 20, 2017, 1:54:45 AM3/20/17
to pushy
Hi Murali,

As Pussy's Github wiki said, you can choose OpenSSL as the TLS provider, but Pussy also mentioned that If you use Tomcat as a container, you will probably encounter some conflict issue. please refer to the page:
 

Regards,
David
Reply all
Reply to author
Forward
0 new messages