我正在构建一个应用程序,使用notnoop的java-apns库从ColdFusion 8向Apple设备发送推送通知,并且在调用库中的方法时,我收到“找不到方法”异常,即使该方法是clearly defined in the library(第161行)。我能够成功发送推送通知,只有这一种方法不起作用。这里可能有什么问题???
代码:
<cfscript>
LOCAL.APNSService =
CreateObject("java", "com.notnoop.apns.APNS").newService()
.withCert(
"MyCert.p12",
"MyPassword"
)
.withProductionDestination()
.build();
LOCAL.APNSService.start();
LOCAL.InactiveDevices = LOCAL.APNSService.getInactiveDevices();
LOCAL.payload =
CreateObject("java", "com.notnoop.apns.APNS").newPayload()
.badge(1)
.alertBody("Hello, world.")
.sound("PushNotification.caf")
.build();
LOCAL.APNSNotification =
CreateObject("java", "com.notnoop.apns.SimpleApnsNotification")
.init(
JavaCast("string", LOCAL.MyDeviceToken),
JavaCast("string", LOCAL.payload)
);
LOCAL.APNSService.push(LOCAL.APNSNotification);
LOCAL.APNSService.stop();
</cfscript>
例外:
The getInactiveDevices method was not found.
堆栈追踪:
coldfusion.runtime.java.MethodSelectionException: The getInactiveDevices method was not found.
at coldfusion.runtime.java.ObjectHandler.findMethodUsingCFMLRules(ObjectHandler.java:322)
at coldfusion.runtime.StructBean.invoke(StructBean.java:527)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2300)