Tuesday, October 30, 2018

Netty NoClassDefFoundError JdkAlpnApplicationProtocolNegotiator

PROBLEM:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator
 at io.netty.handler.ssl.JdkSslContext.toNegotiator(JdkSslContext.java:285)
 at io.netty.handler.ssl.JdkSslClientContext.(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:408)

c.r.p.a.ApnsClientBuilder Native SSL provider not available; will use JDK SSL provider.

OpenSSL available? false
ALPN supported?    false
Reason for unavailability:
java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty-tcnative-linux-x86_32, netty-tcnative-linux-x86_32-fedora, netty-tcnative]
        at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:178)
        at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:384)
        at io.netty.handler.ssl.OpenSsl.(OpenSsl.java:84)
        at OpenSslZav.main(OpenSslZav.java:7)


JDK vs OPENSSL
new JdkSslClientContext
new OpenSslClientContext

netty-tcnative-boringssl-static-2.0.0.Final.jar

netty-tcnative-boringssl-static-2.0.0.Final.jar\META-INF\native\
libnetty-tcnative-linux-x86_64.so
libnetty-tcnative-osx-x86_64.jnilib
netty-tcnative-windows-x86_64.dll

SOLUTION:
Update Java to arch 64
ONLY WORKS IN JAVA 64 !!!


No comments: