MobileFirst APNS推送通知因java.net.SocketException失败(连接由远程主机关闭)

时间:2015-07-27 12:36:23

标签: java push-notification ibm-mobilefirst

我有一个MobileFirst应用程序尝试使用生产APNS证书发送推送。

提交推送时我收到此异常:

    INFO: Failed to send message Message(Id=2; Token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; Payload={"aps":{"alert":{"body":"Blah blah blah","action-loc-key":null},"sound":"","badge":1},"payload":"{\"alias\":\"News_fr\",\"custom\":\"data\"}"})... trying again after delay
java.net.SocketException: Connection closed by remote host
        at sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1510)
        at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)
        at java.io.OutputStream.write(OutputStream.java:75)
        at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:240)
        at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:230)
        at com.notnoop.apns.internal.ApnsPooledConnection$2.run(ApnsPooledConnection.java:47)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

服务器在Debian GNU / Linux 7(wheezy)上运行Oracle JRE 1.7和Tomcat 7。 MobileFirst版本是6.3.0。

它与开发证书配合得很好。

我开发了一个独立的Java应用程序(使用JavAPNS而不是Notnoop)在我的本地环境中使用相同的证书重现问题,并且它适用于Java 1.6但不高。

2 个答案:

答案 0 :(得分:1)

为此问题打开了PMR(支持服务单),客户决定将已安装的Java降级到Oracle Java 1.6,之后成功恢复发送推送通知。

答案 1 :(得分:0)

为了将来参考,我还看到apns-certificate-sandbox.p12过时或生成错误时会发生完全错误。通过these instructions重新生成该文件(并重新部署.wlapp)解决了问题。