0

我成功运行了我的应用程序并在我的服务器上注册了一个设备,所以我得到了“ 1 个设备已注册”和“发送消息”按钮。但是当我单击“发送消息”按钮时,我收到以下错误:

我正在使用 tomcat 和 Android 示例项目,如下所述:http: //developer.android.com/google/gcm/server.html

    HTTP Status 500 - Servlet.init() for servlet SendAllMessagesServlet threw exception

    type Exception report

    message Servlet.init() for servlet SendAllMessagesServlet threw exception

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: Servlet.init() for servlet SendAllMessagesServlet threw exception
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
        java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        java.lang.Thread.run(Unknown Source)
    root cause

    java.lang.IllegalArgumentException: argument cannot be null
        com.google.android.gcm.server.Sender.nonNull(Sender.java:553)
        com.google.android.gcm.server.Sender.<init>(Sender.java:88)
        com.google.android.gcm.demo.server.SendAllMessagesServlet.newSender(SendAllMessagesServlet.java:62)
        com.google.android.gcm.demo.server.SendAllMessagesServlet.init(SendAllMessagesServlet.java:53)
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
        java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        java.lang.Thread.run(Unknown Source)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.41 logs.

请有人帮忙请

4

2 回答 2

0

The json-simple-1.1.jar should copy into the WEB-INF/lib folder of your web application. this is the solution :)

于 2014-09-12T08:30:52.923 回答
0

问题是 API Key 。所以我得到了一个新的 api 密钥并将旧的密钥切换为新的密钥,它可以工作:)

于 2013-07-05T10:53:10.703 回答