Failed to load Netty library

1,063 views
Skip to first unread message

Yankun Jin

unread,
May 17, 2016, 5:35:58 PM5/17/16
to Netty discussions
I got these logs when initializing the APNSClient instant, I got Netty fork 16 jar added.  Need assistance , thanks in advance.


0 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory  - Using SLF4J as the default logging framework

4 [main] DEBUG io.netty.util.internal.NativeLibraryLoader  - -Dio.netty.tmpdir: /var/folders/wm/w8th625d5dd1014jksfwzzlr0000gn/T (java.io.tmpdir)

4 [main] DEBUG io.netty.util.internal.NativeLibraryLoader  - -Dio.netty.native.workdir: /var/folders/wm/w8th625d5dd1014jksfwzzlr0000gn/T (io.netty.tmpdir)

4 [main] DEBUG io.netty.util.internal.NativeLibraryLoader  - Unable to load the library: netty-tcnative-osx-x86_64.

java.lang.NullPointerException

at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:178)

at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:161)

at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:78)

at com.relayrides.pushy.apns.ApnsClient.getBaseSslContextBuilder(ApnsClient.java:398)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithCertificateAndPrivateKey(ApnsClient.java:390)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithP12InputStream(ApnsClient.java:386)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithP12File(ApnsClient.java:363)

at com.relayrides.pushy.apns.ApnsClient.<init>(ApnsClient.java:264)

at com.relayrides.pushy.apns.ApnsClient.<init>(ApnsClient.java:238)

at com.....service.Sender.SendAPNS(Sender.java:270)

at com.....sender.SenderApp.run(SenderApp.java:152)

at com.....sender.SenderApp.main(SenderApp.java:98)

6 [main] DEBUG io.netty.util.internal.NativeLibraryLoader  - Unable to load the library: netty-tcnative.

java.lang.NullPointerException

at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:178)

at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:161)

at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:78)

at com.relayrides.pushy.apns.ApnsClient.getBaseSslContextBuilder(ApnsClient.java:398)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithCertificateAndPrivateKey(ApnsClient.java:390)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithP12InputStream(ApnsClient.java:386)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithP12File(ApnsClient.java:363)

at com.relayrides.pushy.apns.ApnsClient.<init>(ApnsClient.java:264)

at com.relayrides.pushy.apns.ApnsClient.<init>(ApnsClient.java:238)

at com.....service.Sender.SendAPNS(Sender.java:270)

at com.....sender.SenderApp.run(SenderApp.java:152)

at com.....sender.SenderApp.main(SenderApp.java:98)

7 [main] DEBUG io.netty.handler.ssl.OpenSsl  - Failed to load netty-tcnative; OpenSslEngine will be unavailable. See http://netty.io/wiki/forked-tomcat-native.html for more information.

java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty-tcnative-osx-x86_64, netty-tcnative]

at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:167)

at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:78)

at com.relayrides.pushy.apns.ApnsClient.getBaseSslContextBuilder(ApnsClient.java:398)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithCertificateAndPrivateKey(ApnsClient.java:390)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithP12InputStream(ApnsClient.java:386)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithP12File(ApnsClient.java:363)

at com.relayrides.pushy.apns.ApnsClient.<init>(ApnsClient.java:264)

at com.relayrides.pushy.apns.ApnsClient.<init>(ApnsClient.java:238)

at com.....service.Sender.SendAPNS(Sender.java:270)

at com.....sender.SenderApp.run(SenderApp.java:152)

at com.....sender.SenderApp.main(SenderApp.java:98)

7 [main] INFO com.relayrides.pushy.apns.ApnsClient  - OpenSSL (via netty-tcnative) not available; will use JDK SSL provider.

77 [main] DEBUG io.netty.handler.ssl.JdkSslContext  - Default protocols (JDK): [TLSv1.2, TLSv1.1, TLSv1] 

78 [main] DEBUG io.netty.handler.ssl.JdkSslContext  - Default cipher suites (JDK): [TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA]

Exception in thread "main" java.lang.NoSuchFieldError: EXT_ALPN

at sun.security.ssl.ALPNExtension.<clinit>(ALPNExtension.java:30)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:348)

at io.netty.handler.ssl.JdkAlpnSslEngine.updateAvailability(JdkAlpnSslEngine.java:48)

at io.netty.handler.ssl.JdkAlpnSslEngine.isAvailable(JdkAlpnSslEngine.java:37)

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:742)

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

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithCertificateAndPrivateKey(ApnsClient.java:392)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithP12InputStream(ApnsClient.java:386)

at com.relayrides.pushy.apns.ApnsClient.getSslContextWithP12File(ApnsClient.java:363)

at com.relayrides.pushy.apns.ApnsClient.<init>(ApnsClient.java:264)

at com.relayrides.pushy.apns.ApnsClient.<init>(ApnsClient.java:238)

at com.....service.Sender.SendAPNS(Sender.java:270)

at com.....sender.SenderApp.run(SenderApp.java:152)

at com.....sender.SenderApp.main(SenderApp.java:98)

이희승 (Trustin Lee)

unread,
May 17, 2016, 8:44:33 PM5/17/16
to ne...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
 

jinyankun gmail

unread,
May 17, 2016, 10:07:56 PM5/17/16
to ne...@googlegroups.com
Hi, Lee

Sorry for the double posting. I  reset all my dependencies, and the error is gone, the OpenSSL decipher suite is found.  I will enclose the DEBUGG LEVEL log here. As I am using pushy , there is still some error about it to fix, other than that, it seems working: 

1 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory  - Using SLF4J as the default logging framework

9 [main] DEBUG io.netty.util.internal.NativeLibraryLoader  - -Dio.netty.tmpdir: /var/folders/wm/w8th625d5dd1014jksfwzzlr0000gn/T (java.io.tmpdir)

9 [main] DEBUG io.netty.util.internal.NativeLibraryLoader  - -Dio.netty.native.workdir: /var/folders/wm/w8th625d5dd1014jksfwzzlr0000gn/T (io.netty.tmpdir)

173 [main] INFO com.relayrides.pushy.apns.ApnsClient  - OpenSSL (via netty-tcnative) is available and supports ALPN; will use OpenSSL.

184 [main] DEBUG io.netty.handler.ssl.OpenSslContext  - Default cipher suite (OpenSSL): [ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-GCM-SHA256, AES128-SHA, AES256-SHA, DES-CBC3-SHA]

190 [main] DEBUG io.netty.util.internal.PlatformDependent0  - java.nio.Buffer.address: available

190 [main] DEBUG io.netty.util.internal.PlatformDependent0  - sun.misc.Unsafe.theUnsafe: available

190 [main] DEBUG io.netty.util.internal.PlatformDependent0  - sun.misc.Unsafe.copyMemory: available

190 [main] DEBUG io.netty.util.internal.PlatformDependent0  - java.nio.Bits.unaligned: true

191 [main] DEBUG io.netty.util.internal.PlatformDependent  - Java version: 8

191 [main] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.noUnsafe: false

191 [main] DEBUG io.netty.util.internal.PlatformDependent  - sun.misc.Unsafe: available

192 [main] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.noJavassist: false

192 [main] DEBUG io.netty.util.internal.PlatformDependent  - Javassist: unavailable

192 [main] DEBUG io.netty.util.internal.PlatformDependent  - You don't have Javassist in your class path or you don't have enough permission to load dynamically generated classes.  Please check the configuration for better performance.

193 [main] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.tmpdir: /var/folders/wm/w8th625d5dd1014jksfwzzlr0000gn/T (java.io.tmpdir)

193 [main] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.bitMode: 64 (sun.arch.data.model)

193 [main] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.noPreferDirect: false

194 [main] DEBUG io.netty.handler.ssl.CipherSuiteConverter  - Cipher suite mapping: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 => ECDHE-ECDSA-AES256-GCM-SHA384

194 [main] DEBUG io.netty.handler.ssl.CipherSuiteConverter  - Cipher suite mapping: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 => ECDHE-ECDSA-AES128-GCM-SHA256

194 [main] DEBUG io.netty.handler.ssl.CipherSuiteConverter  - Cipher suite mapping: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 => ECDHE-RSA-AES256-GCM-SHA384

195 [main] DEBUG io.netty.handler.ssl.CipherSuiteConverter  - Cipher suite mapping: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 => ECDHE-RSA-AES128-GCM-SHA256

195 [main] DEBUG io.netty.handler.ssl.CipherSuiteConverter  - Cipher suite mapping: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 => DHE-RSA-AES128-GCM-SHA256

195 [main] DEBUG io.netty.handler.ssl.CipherSuiteConverter  - Cipher suite mapping: TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 => DHE-DSS-AES128-GCM-SHA256

195 [main] DEBUG io.netty.handler.ssl.CipherSuiteConverter  - Cipher suite mapping: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 => DHE-RSA-AES256-GCM-SHA384

195 [main] DEBUG io.netty.handler.ssl.CipherSuiteConverter  - Cipher suite mapping: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 => DHE-DSS-AES256-GCM-SHA384

217 [main] DEBUG io.netty.buffer.AbstractByteBuf  - -Dio.netty.buffer.bytebuf.checkAccessible: true

218 [main] DEBUG io.netty.util.ResourceLeakDetector  - -Dio.netty.leakDetection.level: simple

218 [main] DEBUG io.netty.util.ResourceLeakDetector  - -Dio.netty.leakDetection.maxRecords: 4

226 [main] DEBUG io.netty.util.internal.Cleaner0  - java.nio.ByteBuffer.cleaner(): available

274 [main] DEBUG io.netty.channel.MultithreadEventLoopGroup  - -Dio.netty.eventLoopThreads: 16

292 [main] DEBUG io.netty.channel.nio.NioEventLoop  - -Dio.netty.noKeySetOptimization: false

292 [main] DEBUG io.netty.channel.nio.NioEventLoop  - -Dio.netty.selectorAutoRebuildThreshold: 512

303 [main] WARN com.relayrides.pushy.apns.ApnsClient  - Asked for socket channel class to work with null event loop group, returning NioSocketChannel class.

330 [main] DEBUG io.netty.channel.DefaultChannelId  - -Dio.netty.processId: 67049 (auto-detected)

333 [main] DEBUG io.netty.util.NetUtil  - Loopback interface: lo0 (lo0, 0:0:0:0:0:0:0:1)

334 [main] DEBUG io.netty.util.NetUtil  - /proc/sys/net/core/somaxconn: 128 (non-existent)

336 [main] DEBUG io.netty.channel.DefaultChannelId  - -Dio.netty.machineId: ac:bc:32:ff:fe:d3:1d:43 (auto-detected)

336 [main] DEBUG io.netty.util.internal.ThreadLocalRandom  - -Dio.netty.initialSeedUniquifier: 0xcd654a6c1d08cf1d (took 0 ms)

350 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.numHeapArenas: 16

350 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.numDirectArenas: 16

350 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.pageSize: 8192

351 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.maxOrder: 11

351 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.chunkSize: 16777216

351 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.tinyCacheSize: 512

351 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.smallCacheSize: 256

351 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.normalCacheSize: 64

351 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.maxCachedBufferCapacity: 32768

351 [main] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.cacheTrimInterval: 8192

357 [main] DEBUG io.netty.buffer.ByteBufUtil  - -Dio.netty.allocator.type: pooled

358 [main] DEBUG io.netty.buffer.ByteBufUtil  - -Dio.netty.threadLocalDirectBufferSize: 65536

358 [main] DEBUG io.netty.buffer.ByteBufUtil  - -Dio.netty.maxThreadLocalCharBufferSize: 16384

12364 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler  - -Dio.netty.recycler.maxCapacity: 262144




_____________________Pushy Error_________________________________________

Exception in thread "main" 22391 [nioEventLoopGroup-2-1] INFO com.relayrides.pushy.apns.ApnsClient  - Failed to connect.

javax.net.ssl.SSLException: handshake timed out

java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder

at com.relayrides.pushy.apns.util.ApnsPayloadBuilder.<clinit>(ApnsPayloadBuilder.java:80)

at com.aaa.service.Sender.SendAPNS(Sender.java:277)

at com.aaa.sender.SenderApp.run(SenderApp.java:151)

at com.aaa.sender.SenderApp.main(SenderApp.java:97)

Caused by: java.lang.ClassNotFoundException: com.google.gson.GsonBuilder

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

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

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

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

... 4 more

22404 [nioEventLoopGroup-2-1] WARN io.netty.handler.ssl.ApplicationProtocolNegotiationHandler  - [id: 0x33c1cbff, L:/192.168.49.159:57080 - R:api.development.push.apple.com/17.110.227.100:443] TLS handshake failed:

javax.net.ssl.SSLException: handshake timed out




Thank you very much! 


Best, 


Yankun 


--
You received this message because you are subscribed to a topic in the Google Groups "Netty discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/netty/3APcFZ7IvWc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/1463532266.2585034.610945817.4880562F%40webmail.messagingengine.com.

Norman Maurer

unread,
May 18, 2016, 12:40:48 AM5/18/16
to ne...@googlegroups.com
Seems like you are missing the gson dependency.

jinyankun gmail

unread,
May 18, 2016, 4:46:45 PM5/18/16
to ne...@googlegroups.com
Yeah, I add it and works. Thank you.

Reply all
Reply to author
Forward
0 new messages