PUSHY не удалось отправить push-уведомление от Apple на tomcat 7

Я использую PUSHY (0.13.3) со всеми зависимостями от tomcat 7 для отправки кода push-уведомлений:

SimpleApnsPushNotification pushNotification = new SimpleApnsPushNotification(token, "com.xxxx.app", payload);

apnsClient = new ApnsClientBuilder()
                    .setApnsServer(bpushProd ? ApnsClientBuilder.PRODUCTION_APNS_HOST:ApnsClientBuilder.DEVELOPMENT_APNS_HOST, ApnsClientBuilder.ALTERNATE_APNS_PORT)
                    .setSigningKey(ApnsSigningKey.loadFromPkcs8File(new File(pathToP8File),
                            "TEAMID", "KEYID"))
                    .build();

final PushNotificationFuture<SimpleApnsPushNotification, PushNotificationResponse<SimpleApnsPushNotification>>
                    sendNotificationFuture = apnsClient.sendNotification(pushNotification);

try {
final PushNotificationResponse<SimpleApnsPushNotification> pushNotificationResponse = sendNotificationFuture.get();

if (pushNotificationResponse.isAccepted()) {
    System.out.println(" ^^^ Push notification accepted by APNs gateway.");
} else {
        System.out.println("**** Notification rejected by the APNs gateway: " +
                                    pushNotificationResponse.getRejectionReason() + "\n****"+ pushNotificationResponse.toString());

if (pushNotificationResponse.getTokenInvalidationTimestamp() != null) {
    System.out.println("\t…and the token is invalid as of " + pushNotificationResponse.getTokenInvalidationTimestamp());
 }
}
} catch (final ExecutionException e) {
    System.err.println("Failed to send push notification.");
                        e.printStackTrace();
                    }

но получил исключение

java.net.UnknownHostException: не удалось разрешить "api.push.apple.com" после 2 запросов на io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:718) на io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:679) при io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:335) при io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:324) при гипергликемии.NETty.resolver.dns.DnsResolveContext.access$700(DnsResolveContext.java:62) по адресу io.netty.resolver.dns.DnsResolveContext$3.operationComplete(DnsResolveContext.java:375) по адресу io.netty.unoef DefaultPromise.java:511) на io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485) на io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424) на io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:162) в io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:33) на io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:350) на io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:324) на io.netty.resolver.cessvete $ 700 (DnsResolveContext.java:62) на io.netty.resolver.dns.DnsResolveContext$3.operationComplete(DnsResolveContext.java:375) на io.netty.util.concurrent.DefaultPromise.notifyListener0(по умолчанию: at5ise.j).NETty.util.concurrent.DefaultPromise.notifyListenersNow (DefaultPromise.java:485) в io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424) в io.netty.util.concurrent.DefaultPromise.PadListen. Java: 162) на io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:33) на io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:350) на io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:324) в io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:767) в io.netty.resolver.dns.DnsResolveContext.internalResolve(DnsResolveContext.java:229) в io.netty.resolver.dns.DnsResolveContext.resolve(DnsResolveContext.java:161) в io.netty.resolver.dns.DnsNameResolver.olol (at)..netty.resolver.dns.DnsNameResolver.:81) на io.netty.resolver.dns.InflightNameResolver.resolve(InflightNameResolver.java:96) на io.netty.resolver.dns.InflightNameResolver.resolveAll(InflightNameResolver.java:71) на io.netty.resol.ver.InflightNameResolver.resolveAll(InflightNameResolver.java:56) в io.netty.resolver.RoundRobinInetAddressResolver.doResolve(RoundRobinInetAddressResolver.java:57) в io.netty.resolver.SimpleNolver.olol.SimpleNameResolver.resolve(SimpleNameResolver.java:55) в io.netty.resolver.InetSocketAddressResolver..Bootstrap.doResolveAndConnect0(Bootstrap.java:208) в io.netty.bootstrap.Bootstrap.doResolveAndConnect(Bootstrap.java:170) в io.netty.bootstrap.Bootstrap.connect(Bootstrap.java.9:11) pushy.apns.ApnsChannelFactory$3.run(ApnsChannelFactory.java:197) в io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38) в io.netty.util.concurrent.SkturnSune.java:125) по адресу io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) по адресу io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:40ty.inelo:404 at.nio.NioEventLoop.run(NioEventLoop.java:465) в io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) на io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) на java.lang.Thread.run(Thread.java:745). Причина: io.NETty.resolver.dns.DnsNameResolverException: [/2001:4860:4860:0:0:0:0:8844:53] не удалось отправить запрос (трассировка стека недоступна). Причина: java.net.SocketException: сеть недостижим в sun.nio.ch.DatagramChannelImpl.send0(собственный метод) в sun.nio.ch.DatagramChannelImpl.sendFromNativeBuffer(DatagramChannelImpl.java:517) в sun.nio.ch.DatagramChannelImpl.senel: Data athanChannel sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:458) по адресу io.netty.channel.socket.nio.NioDatagramChannel.doWriteMessage(NioDatagramChannel.java:293) по адресу io.netty.channel.nio.Wane (). AbstractNioMessageChannel.java:142) в io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:934) в io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:360) в io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:901) в io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1396) в io.netty.chan.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776) при io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768) при io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749) при io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115) по адресу io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776) по адресу io.netty.channel.AnthaContehContaintehanChannel.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) в io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) в io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1066) в io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:305) в io.netty.resolxt.ns.writeQuery(DnsQueryContext.java:132) на io.netty.resolver.dns.DnsQueryContext.sendQuery(DnsQueryContext.java:114) на io.netty.resolver.dns.DnsQueryContext.query(DnsQueryo.9) netty.resolver.dns.DnsNameResolver.query0(DnsNameResolver.java:948) в io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:343) в io.netty.resolver.dns.Dnsxtesvecon (Java: 324) в io.netty.resolver.dns.DnsResolveContext.access$700(DnsResolveContext.java:62) в io.netty.resolver.dns.DnsResolveContext$3.operationComplete(DnsResolveContext.java:375) в io.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511) в io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485) в io.netty.util.c oncurrent.DefaultPromise.notifyListeners (DefaultPromise.java:424) в io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:162) в io.netty.util.concurrent.DefaultPromise.addListener (DefaultPromise). в io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:350) в io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:324) в io.netty.resolver.quveteR. (DnsResolveContext.java:767) по адресу io.netty.resolver.dns.DnsResolveContext.internalResolve (DnsResolveContext.java:229) по адресу io.netty.resolver.dns.DnsResolveContext.resolve (dnsResolve.net).resolver.dns.DnsNameResolver.doResolveAllUncached(DnsNameResolver.java:833) на io.netty.resolver.dns.DnsNameResolver.doResolveAll(DnsNameResolver.java:788) на io.netty.resver 756) на io.netty.resolver.SimpleNameResolver.resolveAll(SimpleNameResolver.java:81) на io.netty.resolver.dns.InflightNameResolver.resol ve (InflightNameResolver.java:96) по адресу io.netty.resolver.dns.InflightNameResolver.resolveAll(InflightNameResolver.java:71) по адресу io.netty.resolver.dns.InflightNameResolver.resolve.all (InflightNameoesty.ty) atolol.resolver.RoundRobinInetAddressResolver.NETty.resolver.InetSocketAddressResolver.doResolve (InetSocketAddressResolver.java:57) в io.netty.resolver.InetSocketAddressResolver.doResolve(InetSocketAddressResolver.java:32res.netty.bootstrap.Bootstrap.doResolveAndConnect0(Bootstrap.java:208) в io.netty.bootstrap.Bootstrap.doResolveAndConnect(Bootstrap.java:170) в io.netty.bootstrap.Bootstrap.pava.connect com.turo.pushy.apns.ApnsChannelFactory$3.run(ApnsChannelFactory.java:197) в io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38) в io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:125) в io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) в io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) в io.netty.channel.vent.ventEvent.Noop: 465) в io.netty.util.concurrent.SingleThreadEventExecutor $ 5.run (SingleThreadEventExecutor.java:884) в io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) в java.lang. (Thread.java:745)

0 ответов

Другие вопросы по тегам