在 GAE 中使用 javapns 时 SSLSocketImpl.receivedChangeCipherSpec 出现 NoSuchMethodError 异常

NoSuchMethodError exception on SSLSocketImpl.receivedChangeCipherSpec when using javapns in GAE

我在 Google App Engine 中使用 javapns。直到今天早上一切正常。现在,它引发了这个异常:

java.lang.NoSuchMethodError: sun.security.ssl.SSLSocketImpl.receivedChangeCipherSpec()Z
    at sun.security.ssl.Handshaker.receivedChangeCipherSpec(Handshaker.java:356)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:347)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:901)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:837)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1026)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1324)
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:712)
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
    at java.io.OutputStream.write(OutputStream.java:75)
    at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:402)
    at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:350)
    at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:320)
    at javapns.Push.sendPayload(Push.java:177)
    at javapns.Push.payload(Push.java:149)

有什么想法吗?我在 JDK7u 中看到了缺少的方法,但我想我正在使用 JDK7。不确定这是否相关。

我就此问题联系了 Google 支持并得到以下回复:

This is a known issue that is already resolved.

他们没有透露根本原因。

我试图将 BigTable 客户端和 运行 用于同一问题。这是由于 Google API 使用带 TLS 的 HTTP2。用于支持 TLS 的 ALPN 库会在启动时修改字节码,并与 JRE/JDK 你 运行 的版本紧密结合。检查 http://www.eclipse.org/jetty/documentation/current/alpn-chapter.html 处的 "Versions" table 以将 ALPN 的特定版本与您的 JRE 相匹配,您应该没问题。