我在用androidpn做服务端向客户端推送消息的功能。
服务端已经可以正常启动。
接下来我要启动我的客户端,我是用的android虚拟机,在客户端APP打开时,
要和服务端建立连接,分三步:建立连接(connection)、注册(Register)、登陆(Login)
从我的日志可以看出,已经成功建立连接,但在注册时出现异常:
- Java code
06-28 11:07:29.532: D/DemoAppActivity(259): onCreate()...06-28 11:07:29.792: I/Androidpn_ServiceManager(259): Callback Activity...06-28 11:07:29.812: I/Androidpn_ServiceManager(259): apiKey=20120628171006-28 11:07:29.812: I/Androidpn_ServiceManager(259): xmppHost=10.0.2.206-28 11:07:29.812: I/Androidpn_ServiceManager(259): xmppPort=522206-28 11:07:30.362: D/Androidpn_NotificationService(259): onCreate()...06-28 11:07:30.412: D/Androidpn_NotificationService(259): deviceId=EMU131592204002731935206-28 11:07:30.432: D/Androidpn_NotificationService(259): onStart()...06-28 11:07:30.502: D/Androidpn_NotificationService(259): start()...06-28 11:07:30.502: D/Androidpn_NotificationService(259): registerConnectivityReceiver()...06-28 11:07:30.532: D/Androidpn_PhoneStateChangeListener(259): onDataConnectionStateChanged()...06-28 11:07:30.532: D/Androidpn_PhoneStateChangeListener(259): Data Connection State = DATA_CONNECTED06-28 11:07:30.532: D/Androidpn_NotificationService(259): connect()...06-28 11:07:30.552: D/Androidpn_ConnectivityReceiver(259): ConnectivityReceiver.onReceive()...06-28 11:07:30.552: D/Androidpn_ConnectivityReceiver(259): action=android.net.conn.CONNECTIVITY_CHANGE06-28 11:07:30.562: D/Androidpn_ConnectivityReceiver(259): Network Type = mobile06-28 11:07:30.562: D/Androidpn_ConnectivityReceiver(259): Network State = CONNECTED06-28 11:07:30.585: D/Androidpn_XmppManager(259): connect()...06-28 11:07:30.592: D/Androidpn_XmppManager(259): submitLoginTask()...06-28 11:07:30.592: I/Androidpn_ConnectivityReceiver(259): Network connected06-28 11:07:30.592: D/Androidpn_NotificationService(259): connect()...06-28 11:07:30.592: D/Androidpn_XmppManager(259): submitRegisterTask()...06-28 11:07:30.592: D/Androidpn_XmppManager(259): submitConnectTask()...06-28 11:07:30.592: D/Androidpn_XmppManager(259): addTask(runnable)...06-28 11:07:30.592: D/Androidpn_NotificationService(259): Incremented task count to 106-28 11:07:30.592: D/Androidpn_XmppManager(259): addTask(runnable)... done06-28 11:07:30.592: D/Androidpn_XmppManager(259): addTask(runnable)...06-28 11:07:30.612: D/Androidpn_NotificationService(259): Incremented task count to 206-28 11:07:30.612: D/Androidpn_XmppManager(259): addTask(runnable)... done06-28 11:07:30.622: D/Androidpn_XmppManager(259): addTask(runnable)...06-28 11:07:30.622: D/Androidpn_NotificationService(259): Incremented task count to 306-28 11:07:30.622: D/Androidpn_XmppManager(259): addTask(runnable)... done06-28 11:07:30.622: D/Androidpn_XmppManager(259): connect()...06-28 11:07:30.622: D/Androidpn_XmppManager(259): submitLoginTask()...06-28 11:07:30.622: D/Androidpn_XmppManager(259): submitRegisterTask()...06-28 11:07:30.622: D/Androidpn_XmppManager(259): submitConnectTask()...06-28 11:07:30.622: D/Androidpn_XmppManager(259): addTask(runnable)...06-28 11:07:30.622: D/Androidpn_NotificationService(259): Incremented task count to 406-28 11:07:30.632: D/Androidpn_XmppManager(259): addTask(runnable)... done06-28 11:07:30.632: D/Androidpn_XmppManager(259): addTask(runnable)...06-28 11:07:30.632: D/Androidpn_NotificationService(259): Incremented task count to 506-28 11:07:30.632: D/Androidpn_XmppManager(259): addTask(runnable)... done06-28 11:07:30.642: D/Androidpn_XmppManager(259): addTask(runnable)...06-28 11:07:30.642: D/Androidpn_NotificationService(259): Incremented task count to 606-28 11:07:30.642: D/Androidpn_XmppManager(259): addTask(runnable)... done06-28 11:07:30.642: I/Androidpn_XmppManager(259): ConnectTask.run()...06-28 11:07:30.712: I/global(259): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.06-28 11:07:30.712: I/global(259): Default buffer size used in BufferedWriter constructor. It would be better to be explicit if an 8k-char buffer is required.06-28 11:07:45.771: I/Androidpn_XmppManager(259): XMPP connected successfully06-28 11:07:45.781: D/Androidpn_XmppManager(259): runTask()...06-28 11:07:45.781: D/Androidpn_NotificationService(259): Decremented task count to 506-28 11:07:45.781: D/Androidpn_XmppManager(259): runTask()...done06-28 11:07:45.781: D/Androidpn_XmppManager(259): connect()...06-28 11:07:45.781: D/Androidpn_XmppManager(259): submitLoginTask()...06-28 11:07:45.781: D/Androidpn_XmppManager(259): submitRegisterTask()...06-28 11:07:45.781: D/Androidpn_XmppManager(259): submitConnectTask()...06-28 11:07:45.781: D/Androidpn_XmppManager(259): addTask(runnable)...06-28 11:07:45.781: D/Androidpn_NotificationService(259): Incremented task count to 606-28 11:07:45.791: D/Androidpn_XmppManager(259): addTask(runnable)... done06-28 11:07:45.791: D/Androidpn_XmppManager(259): addTask(runnable)...06-28 11:07:45.791: D/Androidpn_NotificationService(259): Incremented task count to 706-28 11:07:45.791: D/Androidpn_XmppManager(259): addTask(runnable)... done06-28 11:07:45.791: D/Androidpn_XmppManager(259): addTask(runnable)...06-28 11:07:45.791: D/Androidpn_NotificationService(259): Incremented task count to 806-28 11:07:45.791: D/Androidpn_XmppManager(259): addTask(runnable)... done06-28 11:07:45.791: I/Androidpn_XmppManager(259): RegisterTask.run()...06-28 11:07:45.992: D/RegisterTask.PacketListener(259): processPacket().....06-28 11:07:45.992: D/RegisterTask.PacketListener(259): packet=<iq id="w5DK7-0" to="127.0.0.1/a3829369" type="error"><query xmlns="jabber:iq:register"><password>900bd2f44aeb49c58041a1d9b153345f</password><username>50a04637646a4bbeb6981243a62aa9f6</username></query><error code="500" type="WAIT"><internal-server-error xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>06-28 11:07:46.002: E/Androidpn_XmppManager(259): Unknown error while registering XMPP account! internal-server-error