IOS推送http2使用netty服务启动异常

IOS推送http2使用netty服务启动异常

现象

使用netty开发×××送HTTP2,本机运行正常,部署至linux服务器异常。

原因

是linux服务器内核版本过低,所使用GLIBC类库版本过低。netty要求GLIBC_2.10,我的服务器最高才GLIBC_2.5。

linux查看GLIBC版本命令

strings /lib64/libc.so.6 |grep GLIBC_

解决办法

升级linux内核版本以及GLIBC类库版本。

以下附netty服务器异常日志



2018-11-18 16:54:30 [ appleJobScheduler_Worker-1:64224 ] - [ DEBUG ] io.netty.util.internal.NativeLibraryLoader:91 Unable to load the library: netty-tcnative-linux-x86_64.
java.lang.UnsatisfiedLinkError: /tmp/libnetty-tcnative-linux-x86_648869710963839557158.so: /lib64/libc.so.6: version `GLIBC_2.10‘ not found (required by /tmp/libnetty-tcnative-linux-x86_648869710963839557158.so)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1062)
at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:214)
at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:161)
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:238)
at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:65)
at javapns.http2.client.ApnsHttp2Client.getBaseSslContextBuilder(ApnsHttp2Client.java:151)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithCertificateAndPrivateKey(ApnsHttp2Client.java:143)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithP12InputStream(ApnsHttp2Client.java:139)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:86)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:82)
at javapns.http2.client.ApnsHttp2.<init>(ApnsHttp2.java:48)
at com.pushservicenotificationios.javapns.http2.config.ApnsHttp2Config.getAppleServer(ApnsHttp2Config.java:53)
at com.pushservicenotificationios.admin.process.ReceiveProcess.receive(ReceiveProcess.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
2018-11-18 16:54:30 [ appleJobScheduler_Worker-1:64229 ] - [ DEBUG ] io.netty.util.internal.NativeLibraryLoader:91 Unable to load the library: netty-tcnative-linux-x86_64-fedora.
java.lang.UnsatisfiedLinkError: no netty-tcnative-linux-x86_64-fedora in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:189)
at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:161)
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:238)
at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:65)
at javapns.http2.client.ApnsHttp2Client.getBaseSslContextBuilder(ApnsHttp2Client.java:151)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithCertificateAndPrivateKey(ApnsHttp2Client.java:143)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithP12InputStream(ApnsHttp2Client.java:139)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:86)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:82)
at javapns.http2.client.ApnsHttp2.<init>(ApnsHttp2.java:48)
at com.pushservicenotificationios.javapns.http2.config.ApnsHttp2Config.getAppleServer(ApnsHttp2Config.java:53)
at com.pushservicenotificationios.admin.process.ReceiveProcess.receive(ReceiveProcess.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
2018-11-18 16:54:30 [ appleJobScheduler_Worker-1:64232 ] - [ DEBUG ] io.netty.util.internal.NativeLibraryLoader:91 Unable to load the library: netty-tcnative.
java.lang.UnsatisfiedLinkError: no netty-tcnative in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:189)
at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:161)
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:238)
at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:65)
at javapns.http2.client.ApnsHttp2Client.getBaseSslContextBuilder(ApnsHttp2Client.java:151)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithCertificateAndPrivateKey(ApnsHttp2Client.java:143)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithP12InputStream(ApnsHttp2Client.java:139)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:86)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:82)
at javapns.http2.client.ApnsHttp2.<init>(ApnsHttp2.java:48)
at com.pushservicenotificationios.javapns.http2.config.ApnsHttp2Config.getAppleServer(ApnsHttp2Config.java:53)
at com.pushservicenotificationios.admin.process.ReceiveProcess.receive(ReceiveProcess.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
2018-11-18 16:54:30 [ appleJobScheduler_Worker-1:64235 ] - [ DEBUG ] io.netty.handler.ssl.OpenSsl:91 Failed to load netty-tcnative; OpenSslEngine will be unavailable, unless the application has already loaded the symbols by some other means. 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-linux-x86_64, netty-tcnative-linux-x86_64-fedora, netty-tcnative]
at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:167)
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:238)
at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:65)
at javapns.http2.client.ApnsHttp2Client.getBaseSslContextBuilder(ApnsHttp2Client.java:151)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithCertificateAndPrivateKey(ApnsHttp2Client.java:143)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithP12InputStream(ApnsHttp2Client.java:139)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:86)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:82)
at javapns.http2.client.ApnsHttp2.<init>(ApnsHttp2.java:48)
at com.pushservicenotificationios.javapns.http2.config.ApnsHttp2Config.getAppleServer(ApnsHttp2Config.java:53)
at com.pushservicenotificationios.admin.process.ReceiveProcess.receive(ReceiveProcess.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
2018-11-18 16:54:30 [ appleJobScheduler_Worker-1:64237 ] - [ DEBUG ] io.netty.handler.ssl.OpenSsl:91 Failed to initialize netty-tcnative; OpenSslEngine will be unavailable. See http://netty.io/wiki/forked-tomcat-native.html for more information.
java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.Library.version(I)I
at org.apache.tomcat.jni.Library.version(Native Method)
at org.apache.tomcat.jni.Library.initialize(Library.java:176)
at io.netty.handler.ssl.OpenSsl.initializeTcNative(OpenSsl.java:243)
at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:76)
at javapns.http2.client.ApnsHttp2Client.getBaseSslContextBuilder(ApnsHttp2Client.java:151)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithCertificateAndPrivateKey(ApnsHttp2Client.java:143)
at javapns.http2.client.ApnsHttp2Client.getSslContextWithP12InputStream(ApnsHttp2Client.java:139)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:86)
at javapns.http2.client.ApnsHttp2Client.<init>(ApnsHttp2Client.java:82)
at javapns.http2.client.ApnsHttp2.<init>(ApnsHttp2.java:48)
at com.pushservicenotificationios.javapns.http2.config.ApnsHttp2Config.getAppleServer(ApnsHttp2Config.java:53)
at com.pushservicenotificationios.admin.process.ReceiveProcess.receive(ReceiveProcess.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
2018-11-18 16:54:30 [ appleJobScheduler_Worker-1:64454 ] - [ DEBUG ] io.netty.handler.ssl.JdkSslContext:76 Default protocols (JDK): [TLSv1.2, TLSv1.1, TLSv1]
2018-11-18 16:54:30 [ appleJobScheduler_Worker-1:64455 ] - [ DEBUG ] io.netty.handler.ssl.JdkSslContext:76 Default cipher suites (JDK): [TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA]

原文地址:http://blog.51cto.com/jtech/2319059

时间: 2024-12-21 20:07:50

IOS推送http2使用netty服务启动异常的相关文章

【PHP】iOS推送通知以及反馈服务

近来项目是完成一个PHP的推送服务器,无论是PHP,APNs还是GCM基本上都是从零开始. 写下一点见解,方便以后继续做代码的搬运工. 因为对PHP跟iOS都不熟悉,可能有错漏...穷孩子没有用过iOS的东西... 设备如果希望能够及时收到服务器的消息,大概有三种方式: 1)轮询(Pull)方式:客户端与服务器主动连接查询.因为及时性以及耗电量等要求不可得兼,一般不考虑. 2)SMS(Push)方式:在Android平台,可以通过拦截SMS消息并且解析消息内容来了解服务器的意图,并获取其显示内容

IOS 推送消息 php做推送服务端

IOS推送消息是许多IOS应用都具备的功能,最近也在研究这个功能,参考了很多资料终于搞定了,下面就把步骤拿出来分享下: iOS消息推送的工作机制可以简单的用下图来概括: Provider是指某个iPhone软件的Push服务器,APNS是Apple Push Notification Service的缩写,是苹果的服务器. 上图可以分为三个阶段: 第一阶段:应用程序把要发送的消息.目的iPhone的标识打包,发给APNS. 第二阶段:APNS在自身的已注册Push服务的iPhone列表中,查找有

iOS推送小结--swift语言

APNS的推送机制 首先我们看一下苹果官方给出的对ios推送机制的解释.如下图 Provider就是我们自己程序的后台服务器,APNS是Apple Push Notification Service的缩写,也就是苹果的推送服务器. iPhone当然就是我们的iOS设备了,CllentApp就是我们的客户端程序 第一阶段:应用程序的服务器端把要发送的消息.目的iPhone的标识打包,发给APNS. 第二阶段:APNS在自身的已注册Push服务的iPhone列表中,查找有相应标识的iPhone,并把

iOS推送之远程推送

最近公司项目升级重构(重写),除了本来我所负责的模块,最后临危受命接了推送(远程和本地)相关的模块,顺便把推送的相关知识复习了一遍.后期连续工作十几天加上最后一天的通(瞎)宵(熬)达(一)旦(夜),也算是不辱使命.此文除了讲解远程推送相关的基本知识外,也会涉及一些推送相关的奇淫技巧.另外本文主要讲解远程推送,后续会出一篇iOS推送之本地推送(iOS Notification Of Local Notification)的姊妹篇. 此篇文章的逻辑如下图所示: 图0-0 此篇文章的逻辑图 远程推送原

iOS推送之本地推送

写此文的原因可见此文章的姊妹篇iOS推送之远程推送(iOS Notification Of Remote Notification),如果你看过了它的姊妹篇,了解过了远程推送,那么再来看此本地推送,真真是易如反掌啊! 此篇文章的逻辑如下图所示: 图0-0 此篇文章的逻辑图 本地推送介绍 本地推送和远程推送的功能是一样的,都是要提醒用户去做某些事情.但是和远程推送不同的就是本地推送是不需要设备联网的,而远程推送是必需要设备联网的,因为只有联网状态下,才能和苹果的APNs服务器建立长连接,从而推送消

一步一步教你做ios推送

最近在研究ios的推送问题,遇到了一些问题,最终整理了一下.放在这里和大家分享 APNS的推送机制 首先我们看一下苹果官方给出的对ios推送机制的解释.如下图 Provider就是我们自己程序的后台服务器,APNS是Apple Push Notification Service的缩写,也就是苹果的推送服务器. 上图可以分为三个阶段: 第一阶段:应用程序的服务器端把要发送的消息.目的iPhone的标识打包,发给APNS. 第二阶段:APNS在自身的已注册Push服务的iPhone列表中,查找有相应

iOS 推送证书

push 服务器证书 钥匙串:登入-->证书,选项里面导出证书命名为cert.p12,跟密钥命名为key.p12 需要将上面的2个.p12文件转成.pem格式: openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12 openssl pkcs12 -nocerts -out key.pem -in key.p12 如果需要对 key不进行加密: openssl rsa -in key.pem -out key.unencrypted.

iOS推送小结

iOS推送小结 (吐槽,md的代码编辑功能不知道是不会用还是确实不好用) 1.推送配置 1.1证书配置 请自行谷百. 1.2注册推送 //代码来源:环信Demo //In method application:(UIApplication *)application didFinishLaunchingWithOptions: UIApplication *application = [UIApplication sharedApplication]; //注册APNS if([applicat

教你做IOS推送 包会!

最近在研究iOS的推送问题,遇到了一些问题,最终整理了一下,放在这里和大家分享. APNS的推送机制 首先我们看一下苹果官方给出的对iOS推送机制的解释.如下图 Provider就是我们自己程序的后台服务器,APNS是Apple Push Notification Service的缩写,也就是苹果的推送服务器. 上图可以分为三个阶段: 第一阶段:应用程序的服务器端把要发送的消息.目的iPhone的标识打包,发给APNS. 第二阶段:APNS在自身的已注册Push服务的iPhone列表中,查找有相