码迷,mamicode.com
首页 > 系统相关 > 详细

aSmack连接服务器异常smack.SmackException$ ConnectionException thrown by XMPPConnection.connect();

时间:2014-11-03 11:37:02      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:connectionexception   smackexception   

下面是我在研究asmack4.0出现的异常

06-17 12:02:56.924: W/System.err(10622): org.jivesoftware.smack.SmackException$ConnectionException

06-17 12:02:56.924: W/System.err(10622):           at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPC onnection.java:431)

06-17 12:02:56.940: W/System.err(10622):           at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection. java:799)

06-17 12:02:56.940: W/System.err(10622):           at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:391)

06-17 12:02:56.940: W/System.err(10622):           at com.example.testchat.MainActivity.test(MainActivity.java:121)

06-17 12:02:56.940: W/System.err(10622):           at com.example.testchat.MainActivity.access$0(MainActivity.java:56)

06-17 12:02:56.940: W/System.err(10622):           at com.example.testchat.MainActivity$1.run(MainActivity.java:34)

06-17 12:02:56.940: W/System.err(10622):           at java.lang.Thread.run(Thread.java:856)


找了各种办法也没能解决,最后无意中发现了这个

connectionConfig = new ConnectionConfiguration(
loginConfig.getXmppHost(), loginConfig.getXmppPort(),
loginConfig.getXmppServiceName());
connectionConfig.setSecurityMode(SecurityMode.enabled);

安全模式,对没错,就是安全模式导致认证失败于是我把它改为了disabled,问题解决了

aSmack连接服务器异常smack.SmackException$ ConnectionException thrown by XMPPConnection.connect();

标签:connectionexception   smackexception   

原文地址:http://blog.csdn.net/hellohhj/article/details/40736543

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!