我正在使用WSO2 EMM version 1.1.0
我正在关注enable GCM
指南,但在配置完所有内容后,我在服务器端收到空引用异常
拉每X seconds consumes lots of battery
,所以GCM是必须的。
这会被修复还是有任何解决方法?
谢谢!
TID: [0] [EMM] [2015-02-05 13:32:09,473] ERROR {org.jaggeryjs.jaggery.core.manager.WebAppManager} - org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (gcm#7) {org.jaggeryjs.jaggery.core.manager.WebAppManager}
org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (gcm#7)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:571)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (gcm#7)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at org.mozilla.javascript.gen.gcm_21._c_anonymous_2(gcm:7)
at org.mozilla.javascript.gen.gcm_21.call(gcm)
Caused by: java.lang.NullPointerException
at org.wso2.mobile.gcm.GCMServerBridge.sendDataViaGCM(GCMServerBridge.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
以下是我在设置为GCM时尝试连接服务器时的日志:
W/System.err(26481): java.lang.IllegalArgumentException: Host name may not be null
D/audio_hw_primary( 204): select_devices: out_snd_device(2: speaker) in_snd_device(0: )
W/System.err(26481): at org.apache.http.HttpHost.<init>(HttpHost.java:83)
W/System.err(26481): at org.apache.http.impl.client.AbstractHttpClient.determineTarget(AbstractHttpClient.java:497)
W/System.err(26481): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
W/System.err(26481): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
W/System.err(26481): at org.wso2.emm.agent.proxy.ServerUtilitiesTemp.postData(ServerUtilitiesTemp.java:100)
W/System.err(26481): at org.wso2.emm.agent.proxy.APIController$NetworkCallTask.doInBackground(APIController.java:72)
W/System.err(26481): at org.wso2.emm.agent.proxy.APIController$NetworkCallTask.doInBackground(APIController.java:1)
W/System.err(26481): at android.os.AsyncTask$2.call(AsyncTask.java:288)
W/System.err(26481): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/System.err(26481): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
W/System.err(26481): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err(26481): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err(26481): at java.lang.Thread.run(Thread.java:841)
E/AlreadyRegisteredActivity(26481): The responseStatus is null in onReceiveAPIResult()
答案 0 :(得分:0)
您是否在GCM API key
配置文件中添加了WSO2 EMM server
和发件人ID,您可以在EMM_HOME/repository/deployment/server/jaggeryapps/emm/config/config.json.?
找到配置文件。配置如下:
"ANDROID": {
"NOTIFIER_INTERVAL" : "30000",
"NOTIFIER" : "GCM",
"APIKEY" : "YOUR-KEY",
"SENDERID" : "YOUR-SENDER-ID"
},