Issue inside tomcat container.

114 views
Skip to first unread message

hrishikesh rajpathak

unread,
May 31, 2016, 4:06:28 AM5/31/16
to pushy

I am trying to setup APNS client while starting the container inside ServletContextListner. I am getting following exception. This same certificate and code is working locally.

WARNING [nioEventLoopGroup-2-1] io.netty.util.internal.logging.Slf4JLogger.warn [id: 0x883fe8c3, L:/172.31.17.200:40818 - R:api.development.push.apple.com/17.172.238.203:443] Failed to select the application-level protocol:
 io.netty.handler.codec.DecoderException: java.lang.IllegalAccessError: tried to access field sun.security.ssl.Handshaker.localSupportedSignAlgs from class sun.security.ssl.ClientHandshaker
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:418)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:245)
    at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)
    at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:154)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:354)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:145)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:1078)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:117)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:527)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:484)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:398)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:370)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessError: tried to access field sun.security.ssl.Handshaker.localSupportedSignAlgs from class sun.security.ssl.ClientHandshaker
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:285)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
    at sun.security.ssl.Handshaker$1.run(Handshaker.java:919)
    at sun.security.ssl.Handshaker$1.run(Handshaker.java:916)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1369)
    at io.netty.handler.ssl.SslHandler.runDelegatedTasks(SslHandler.java:1124)
    at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1009)
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:904)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:387)
    ... 14 more

30-May-2016 16:57:39.261 INFO [nioEventLoopGroup-2-1] com.relayrides.pushy.apns.ApnsClient$3.operationComplete Failed to connect.
 java.lang.IllegalStateException: Channel closed before HTTP/2 preface completed.
    at com.relayrides.pushy.apns.ApnsClient$2.operationComplete(ApnsClient.java:708)
    at com.relayrides.pushy.apns.ApnsClient$2.operationComplete(ApnsClient.java:700)
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:683)
    at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:568)
    at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:407)
    at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:82)
    at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1064)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:689)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:667)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:611)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.close(DefaultChannelPipeline.java:1416)
    at io.netty.channel.ChannelHandlerInvokerUtil.invokeCloseNow(ChannelHandlerInvokerUtil.java:133)
    at io.netty.channel.DefaultChannelHandlerInvoker.invokeClose(DefaultChannelHandlerInvoker.java:297)
    at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:226)
    at io.netty.channel.ChannelOutboundHandlerAdapter.close(ChannelOutboundHandlerAdapter.java:71)
    at io.netty.channel.ChannelHandlerInvokerUtil.invokeCloseNow(ChannelHandlerInvokerUtil.java:133)
    at io.netty.channel.DefaultChannelHandlerInvoker.invokeClose(DefaultChannelHandlerInvoker.java:297)
    at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:226)
    at io.netty.handler.ssl.SslHandler$8.operationComplete(SslHandler.java:1447)
    at io.netty.handler.ssl.SslHandler$8.operationComplete(SslHandler.java:1433)
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:683)
    at io.netty.util.concurrent.DefaultPromise.notifyLateListener(DefaultPromise.java:624)
    at io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:139)
    at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:93)
    at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:28)
    at io.netty.handler.ssl.SslHandler.safeClose(SslHandler.java:1433)
    at io.netty.handler.ssl.SslHandler.closeOutboundAndChannel(SslHandler.java:1261)
    at io.netty.handler.ssl.SslHandler.close(SslHandler.java:459)
    at io.netty.channel.ChannelHandlerInvokerUtil.invokeCloseNow(ChannelHandlerInvokerUtil.java:133)
    at io.netty.channel.DefaultChannelHandlerInvoker.invokeClose(DefaultChannelHandlerInvoker.java:297)
    at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:226)
    at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:185)
    at io.netty.handler.ssl.ApplicationProtocolNegotiationHandler.exceptionCaught(ApplicationProtocolNegotiationHandler.java:122)
    at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
    at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
    at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
    at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
    at io.netty.handler.ssl.SslHandler.exceptionCaught(SslHandler.java:747)
    at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
    at io.netty.channel.ChannelHandlerInvokerUtil.notifyHandlerException(ChannelHandlerInvokerUtil.java:219)
    at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:85)
    at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:154)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:354)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:145)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:1078)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:117)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:527)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:484)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:398)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:370)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145)
    at java.lang.Thread.run(Thread.java:745)

30-May-2016 16:57:39.286 WARNING [nioEventLoopGroup-2-1] io.netty.util.internal.logging.Slf4JLogger.warn [id: 0x883fe8c3, L:/172.31.17.200:40818 ! R:api.development.push.apple.com/17.172.238.203:443] TLS handshake failed:
 java.nio.channels.ClosedChannelException

Any help? The jars I am using are: alpn-boot-8.1.6.v20151105.jar and alpn-api-1.1.2.v20150522.jar with tomcat 8

Jon Chambers

unread,
Jun 3, 2016, 12:41:44 PM6/3/16
to pushy
Well, according to the docs, an `IllegalAccessError` is:

> Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to.

That may indicate that you have a mismatch between your alpn-boot version and the JDK you're running. Are the JDK versions different between your local and server environments?

-Jon

--
Pushy is an open-source Java library for sending APNs (iOS and OS X) push notifications. Pushy is brought to you by the engineers at RelayRides.
---
You received this message because you are subscribed to the Google Groups "pushy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pushy-apns+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages