我在 iOS 上有一个带有推送通知的 Worklight 6.1 应用程序。它工作正常,直到 Worklight 服务器出现问题。之后的所有推送通知都会失败,直到服务器重新启动。
Worklight 服务器是 Linux x86_64 上的 Liberty 8.5.5.0 使用 JDK:java-1.7.0-ibm-1.7.0.5.0.x86_64 Worklight 数据库是 Derby(这是一个测试服务器)
当我启动服务器时,一切都很好。
服务器启动 10 分钟后,我看到:
[2/20/14 19:39:15:319 CST] 0000003e com.notnoop.apns.internal.ApnsFeedbackConnection W Failed to retreive invalid devices
java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.j: End user tried to act as a CA
但这似乎并没有破坏任何东西。推送通知仍然有效。服务器启动 30 分钟后,我看到:
[2/20/14 19:59:48:657 CST] 00000061 com.ibm.ws.webcontainer.util.ApplicationErrorUtils E SRVE0777E: Exception thrown by application class 'org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException:365'
org.jboss.resteasy.spi.UnhandledException: org.springframework.dao.InvalidDataAccessApiUsageException: Multiple DISTINCT aggregates are not supported at this time. {SELECT COUNT(DISTINCT t0.DEVICE), COUNT(DISTINCT t1.ID) FROM NOTIFICATION_DEVICE t0 INNER JOIN NOTIFICATION_USER t1 ON t0.USERSUBSCRIPTIONID = t1.ID WHERE (t0.APPLICATIONID IN (?) AND t0.PLATFORM = ?)} [code=30000, state=42Z02]; nested exception is <openjpa-1.2.2-r422266:898935 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Multiple DISTINCT aggregates are not supported at this time. {SELECT COUNT(DISTINCT t0.DEVICE), COUNT(DISTINCT t1.ID) FROM NOTIFICATION_DEVICE t0 INNER JOIN NOTIFICATION_USER t1 ON t0.USERSUBSCRIPTIONID = t1.ID WHERE (t0.APPLICATIONID IN (?) AND t0.PLATFORM = ?)} [code=30000, state=42Z02]
之后对推送适配器的任何调用都会导致:
[2/21/14 19:06:44:038 CST] 00000090 com.notnoop.apns.internal.ApnsConnectionImpl I Exception while waiting for error code
java.net.SocketException: Socket is closed
at com.ibm.jsse2.qc.j(qc.java:301)
at com.ibm.jsse2.e.read(e.java:32)
at java.io.InputStream.read(InputStream.java:102)
at com.notnoop.apns.internal.ApnsConnectionImpl$1MonitoringThread.run(ApnsConnectionImpl.java:114)
[2/21/14 19:06:44:650 CST] 00000085 com.notnoop.apns.internal.ApnsConnectionImpl I Failed to send message Message(Id=2; Token=499D9813FBC377CCDE787E2749CDA914F826EDF39B0830D4AFEEF7A5D71A1802; Payload={"aps":{"alert":{"body":"You have 4 available messages","action-loc-key":null},"sound":"","badge":4},"payload":"{\"alias\":\"myNotificationPush\"}"})... trying again after delay
javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.j: End user tried to act as a CA
之后的所有重试都会导致同样的失败。
在“最终用户试图充当 CA”和“APNS”上有一些谷歌点击表明这是一个 JDK 1.5 问题(在 1.6 中修复),并且可以通过使用 IbmPKIX 信任管理器来修复,但我是确定我使用的是 JDK 1.7,并且 java.security 中的信任管理器是 PKIX