AnsweredAssumed Answered

CMX / Android: CMX Cloud Server Simulator and CMXClient.registerClient() errors

Question asked by Ideal-Networks on Aug 22, 2014
Latest reply on Aug 26, 2014 by Ideal-Networks

Hi,

 

I'm trying to get the CMX Android sample apps from https://developer.cisco.com/site/networking/mobility/cmx-mobility-services/downloads/index.gsp up and running, alongside an app of my own, by connecting to our local CMX Cloud Server Simulator or the Cisco sandbox at 64.103.26.61:8081

 

Neither example android app can register, nor can the one I am developing. The error is thrown during the CMXClient.getInstance().registerClient(...). Here's the Java stack trace, same for all apps:

 

08-22 09:02:35.250: D/MC(1248): Registration to CMX server has failed.

08-22 09:07:27.681: D/MC(1450): com.cisco.cmx.network.CMXClient$1$1.onFailure(CMXClient.java:545)

08-22 09:07:27.681: D/MC(1450): com.loopj.android.http.AsyncHttpResponseHandler.onFailure(AsyncHttpResponseHandler.java:151)

08-22 09:07:27.682: D/MC(1450): com.loopj.android.http.AsyncHttpResponseHandler.handleFailureMessage(AsyncHttpResponseHandler.java:190)

08-22 09:07:27.682: D/MC(1450): com.loopj.android.http.AsyncHttpResponseHandler.handleMessage(AsyncHttpResponseHandler.java:206)

08-22 09:07:27.683: D/MC(1450): com.loopj.android.http.AsyncHttpResponseHandler$1.handleMessage(AsyncHttpResponseHandler.java:89)

08-22 09:07:27.684: D/MC(1450): android.os.Handler.dispatchMessage(Handler.java:99)

08-22 09:07:27.685: D/MC(1450): android.os.Looper.loop(Looper.java:137)

08-22 09:07:27.685: D/MC(1450): android.app.ActivityThread.main(ActivityThread.java:4424)

08-22 09:07:27.686: D/MC(1450): java.lang.reflect.Method.invokeNative(Native Method)

08-22 09:07:27.688: D/MC(1450): java.lang.reflect.Method.invoke(Method.java:511)

08-22 09:07:27.689: D/MC(1450): com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

08-22 09:07:27.689: D/MC(1450): com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

08-22 09:07:27.691: D/MC(1450): dalvik.system.NativeStart.main(Native Method)

 

The error is the same on multiple devices. I notice that if I change the CMXClient.Configuration's serverURL to a wrong URL (ie not our CMX simulator server, or the Cisco sandbox), the error is the same, but fires after a 10-second ish delay (timeout), whereas when pointing to a valid server url the error is instant. Pointing to a malformed url (eg 444.444.444.444) hangs the app in the CMXClientRegisteringResponseHandler's onStart() and does not trigger the error

 

Our CMX Cloud Server Simulator shows the following node.js stack trace when my android device tries to connect (i.e. at the same time that device throws the above error - ignore the timestamps):

 

2014-08-22T11:19:10.846Z - info: Client register request from: 192.168.28.62

2014-08-22T11:19:10.847Z - info: Client register body: { clientType: 'android',

  pushNotificationRegistrationId: 'APA91bGcsznEJkZjf4VYuEo3j1VRpJdY9xtu-va2beEvamSN1GX6V3RkDcuT_f79ygee5e-QWavRecTvjw_UYfi7T6kjphQ-j2NPwZ7XcDOsjPLFlJQm0GGys61dMqgihf-UhRgFazU2tbvamU5FiQ7MZv8GPybiULqKFy1gMgrq82FPmwy3X2U',

  clientMACAddress: 'E4:40:E2:EF:B5:EA' }

2014-08-22T11:19:10.847Z - info: Client Type: android

2014-08-22T11:19:10.847Z - info: Client push notification registration ID: APA91bGcsznEJkZjf4VYuEo3j1VRpJdY9xtu-va2beEvamSN1GX6V3RkDcuT_f79ygee5e-QWavRecTvjw_UYfi7T6kjphQ-j2NPwZ7XcDOsjPLFlJQm0GGys61dMqgihf-UhRgFazU2tbvamU5FiQ7MZv8GPybiULqKFy1gMgrq82FPmwy3X2U

2014-08-22T11:19:10.847Z - info: No Client AP MAC Address required or set

2014-08-22T11:19:10.847Z - info: No Client IP Address required or set

2014-08-22T11:19:10.847Z - info: Client MAC Address: <*****redacted****>

Error: ENOENT, no such file or directory './config/registered/f8fd5deb6252c596ac40594da757535738e68f96eb11f91bed6c9942f6f12975cbeec8c126b62a9b70b9e40fba794a9a.json'

    at Object.fs.openSync (fs.js:438:18)

    at cloud.post.feedbackBody (/home/idealadmin/cmxCloudServerSimulator.js:273:25)

    at callbacks (/home/idealadmin/node_modules/express/lib/router/index.js:161:37)

    at param (/home/idealadmin/node_modules/express/lib/router/index.js:135:11)

    at pass (/home/idealadmin/node_modules/express/lib/router/index.js:142:5)

    at Router._dispatch (/home/idealadmin/node_modules/express/lib/router/index.js:170:5)

    at Object.router (/home/idealadmin/node_modules/express/lib/router/index.js:33:10)

    at next (/home/idealadmin/node_modules/express/node_modules/connect/lib/proto.js:190:15)

    at Object.cookieParser [as handle] (/home/idealadmin/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js:60:5)

    at next (/home/idealadmin/node_modules/express/node_modules/connect/lib/proto.js:190:15)

 

 

Pointing browser to our https://<our cmx cloud server>:8082/cmx-cloud-server/demo/start results in the following on screen:

 

Error: ENOENT, no such file or directory './config/registered/'

  at Object.fs.readdirSync (fs.js:665:18)

  at cloud.get.directoryName (/home/idealadmin/cmxCloudServerSimulator.js:721:29)

  at callbacks (/home/idealadmin/node_modules/express/lib/router/index.js:161:37)

  at param (/home/idealadmin/node_modules/express/lib/router/index.js:135:11)

  at pass (/home/idealadmin/node_modules/express/lib/router/index.js:142:5)

  at Router._dispatch (/home/idealadmin/node_modules/express/lib/router/index.js:170:5)

  at Object.router (/home/idealadmin/node_modules/express/lib/router/index.js:33:10)

  at next (/home/idealadmin/node_modules/express/node_modules/connect/lib/proto.js:190:15)

  at Object.cookieParser [as handle] (/home/idealadmin/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js:60:5)

  at next (/home/idealadmin/node_modules/express/node_modules/connect/lib/proto.js:190:15)

 

Not sure if the issues are related, would be grateful for some advice please!

Outcomes