Response Exception : java.lang.IllegalStateException: Channel closed before HTTP/2 preface completed

797 views
Skip to first unread message

Nagendra Bhandare

unread,
Jun 11, 2018, 5:51:27 AM6/11/18
to pushy
Dear All,

I am getting the following exception upon triggering sendNotification() method.

my deployment details are as follows


Container :

     Jboss 4.3.2 application server

Operating system : 

    Red Hat Enterprise Linux Server release 6.4 (Santiago)
    Release: 6.4
    LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

Java version :

      java version "1.7.0_101"
     Java(TM) SE Runtime Environment (build 1.7.0_101-b14)
     Java HotSpot(TM) 64-Bit Server VM (build 24.101-b14, mixed mode)
     oracle
 

Artifacts in jboss lib :

     netty-all-4.1.24.Final.jar
     netty-tcnative-2.0.8.Final.jar
     netty-tcnative-2.0.8.Final-linux-x86_64.jar
     pushy-0.13.2.jar
 
     fast-uuid-0.1.jar


Request you to kindly help


     


j...@turo.com

unread,
Jun 11, 2018, 9:19:40 AM6/11/18
to pushy
How often does this happen? Every time? Is there anything else in the logs that might give us more information? Are you using certificate-based or token-based authentication?

-Jon

Nagendra Bhandare

unread,
Jun 11, 2018, 11:59:25 PM6/11/18
to pushy
Hi Jon,

Thanks for your reply. To answer your questions. This issue is happening everytime and following is the exception stacktrace that we are getting 

java.lang.IllegalStateException: Channel closed before HTTP/2 preface completed.
	at com.turo.pushy.apns.ApnsChannelFactory$3$2.operationComplete(ApnsChannelFactory.java:218)
	at com.turo.pushy.apns.ApnsChannelFactory$3$2.operationComplete(ApnsChannelFactory.java:212)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
	at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:103)
	at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
	at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1148)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:764)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:740)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:611)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.close(DefaultChannelPipeline.java:1376)
	at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
	at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
	at io.netty.handler.ssl.SslHandler.closeOutboundAndChannel(SslHandler.java:1586)
	at io.netty.handler.ssl.SslHandler.close(SslHandler.java:710)
	at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
	at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
	at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:465)
	at io.netty.channel.DefaultChannelPipeline.close(DefaultChannelPipeline.java:1003)
	at io.netty.channel.AbstractChannel.close(AbstractChannel.java:238)
	at io.netty.bootstrap.Bootstrap$2.operationComplete(Bootstrap.java:229)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
	at io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:112)
	at io.netty.resolver.InetSocketAddressResolver$1.operationComplete(InetSocketAddressResolver.java:64)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
	at io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:112)
	at io.netty.resolver.RoundRobinInetAddressResolver$1.operationComplete(RoundRobinInetAddressResolver.java:71)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:504)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:483)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
	at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:121)
	at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:740)
	at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:693)
	at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:341)
	at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:330)
	at io.netty.resolver.dns.DnsResolveContext.access$600(DnsResolveContext.java:62)
	at io.netty.resolver.dns.DnsResolveContext$3.operationComplete(DnsResolveContext.java:381)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
	at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:121)
	at io.netty.resolver.dns.DnsQueryContext.setFailure(DnsQueryContext.java:223)
	at io.netty.resolver.dns.DnsQueryContext.access$300(DnsQueryContext.java:42)
	at io.netty.resolver.dns.DnsQueryContext$4.run(DnsQueryContext.java:162)
	at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:125)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:745)

Also We are using certificate based authentication 

Jon Chambers

unread,
Jun 12, 2018, 8:33:59 AM6/12/18
to Nagendra Bhandare, pushy
Thanks for sending the full stack trace, but that wasn't quite what I was looking for. Is there a message in the logs NEAR the stack trace that gives any hints as to why the connection may have closed?

If you're using certificate authentication, are you positive you're using the right certificate?

-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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nagendra Bhandare

unread,
Jun 12, 2018, 9:05:00 AM6/12/18
to pushy
Dear Jon,

Thanks for your reply. We are using the correct certificate as the same code works perfectly fine on windows operating system and we are able to trigger push notifications.
To unsubscribe from this group and stop receiving emails from it, send an email to pushy-apns+...@googlegroups.com.
Message has been deleted

Nagendra Bhandare

unread,
Jun 13, 2018, 12:15:28 AM6/13/18
to pushy
Dear All,

The issue is now resolved.

following steps were done to resolve the same

1) configure proxy setting in the code using httpproxyhandlerfactory as shown below

new ApnsClientBuilder().setApnsServer(ApnsClientBuilder.DEVELOPMENT_APNS_HOST).setClientCredentials((File) certInfo.get(0), (String) certInfo.get(1)).setProxyHandlerFactory(new HttpProxyHandlerFactory(new InetSocketAddress("10.10.12.10", 8080))).build();
2) Have following jars in the classpath

      netty-all-4.1.24.Final.jar
      netty-tcnative-boringssl-static-2.0.8.Final-linux-x86_64.jar
      pushy-0.13.2.jar 
      fast-uuid-0.1.jar

Jon Chambers

unread,
Jun 13, 2018, 9:14:56 AM6/13/18
to Nagendra Bhandare, pushy
I'm glad you've resolved the problem.

For future readers, please note that configuring a proxy is NOT a universal solution to this problem. If you don't know that you have a proxy, definitely don't add a proxy handler to your client.

-Jon

To unsubscribe from this group and stop receiving emails from it, send an email to pushy-apns+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages