使用notnoop的java-apns库时导致此错误的原因是什么?

时间:2014-09-17 20:53:43

标签: java coldfusion apple-push-notifications coldfusion-8 javaapns

代码:

<cfset LOCAL.APNSService =
 CreateObject(
 "java",
 "com.notnoop.apns.APNS"
 ).newService(
 ).withCert(
 "MyCert.p12",
 ""
 ).withSandboxDestination().build() />

例外:

java.io.IOException: failed to decrypt safe contents entry:
       java.lang.ArithmeticException: / by zero 

堆栈追踪:

com.notnoop.exceptions.InvalidSSLConfig: java.io.IOException: failed to decrypt safe contents entry: java.lang.ArithmeticException: / by zero
   at com.notnoop.apns.internal.Utilities.newSSLContext(Utilities.java:102)
   at com.notnoop.apns.ApnsServiceBuilder.withCert(ApnsServiceBuilder.java:139)
   at com.notnoop.apns.ApnsServiceBuilder.withCert(ApnsServiceBuilder.java:114)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at coldfusion.runtime.StructBean.invoke(StructBean.java:511)
   at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2300)

1 个答案:

答案 0 :(得分:0)

此错误是由于apns lib要求证书具有密码。使用带密码的新证书后,错误就会停止。