我已经在服务器端和客户端成功地部署了 GCM 示例应用程序。我能够成功注册设备。但是当我尝试向设备发送消息时,服务器日志上显示以下异常:
Exception in thread "pool-1-thread-1" java.lang.IllegalArgumentException: argume
nt cannot be null
at com.google.android.gcm.server.Sender.nonNull(Sender.java:553)
at com.google.android.gcm.server.Sender.getString(Sender.java:534)
at com.google.android.gcm.server.Sender.sendNoRetry(Sender.java:365)
at com.google.android.gcm.server.Sender.send(Sender.java:261)
at com.google.android.gcm.demo.server.SendAllMessagesServlet$1.run(SendA
llMessagesServlet.java:119)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
Exception in thread "pool-1-thread-2" java.lang.IllegalArgumentException: argume
nt cannot be null
at com.google.android.gcm.server.Sender.nonNull(Sender.java:553)
at com.google.android.gcm.server.Sender.getString(Sender.java:534)
at com.google.android.gcm.server.Sender.sendNoRetry(Sender.java:365)
at com.google.android.gcm.server.Sender.send(Sender.java:261)
at com.google.android.gcm.demo.server.SendAllMessagesServlet$1.run(SendA
llMessagesServlet.java:119)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
在浏览器上,
显示以下消息,但由于异常,设备没有收到任何消息。
异步发送 1 个多播消息到 2 个设备
任何提示/建议都会有所帮助。