No response from server Smack org.jivesoftware.smackx.muc.MultiUserChat.create

Exception in thread "main" No response from server.: 
at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:367)
at com.smack.Test3CreateChatGroup.creatMultiRoom(Test3CreateChatGroup.java:44)

这个问题被搞了一天,下班之前终于搞定了,查了很多资料。

具体参考如下(我都没有解决)

1:http://blog.csdn.net/za143567229za/article/details/40654851 

2:http://macleo.iteye.com/blog/1815024

3:应该是网络环境不好

最后看来一个评论,给了我思路:http://blog.csdn.net/lnb333666/article/details/7598683  14楼 传入房间的的jid,不是用户的,我之前遇到过。


 MultiUserChat muc = new MultiUserChat(connection, "wq@192.168.1.1"); 这是我之前的写法(也试过很多种格式,均不行),看完评论觉得是地址写错了 .

接着仔细看了spark的群组,发现是 wq@muc.192.168.1.1。然后加上了muc,之前看了很多案例,都没有加muc,都是直接写的地址,不知道为啥我的要加这个。


不要以为加上这个就可以创建成功了,只是不会报错

还要加很多参数

感觉    muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));    这句最有用。

还有在其他帖子看到的一句话:

  1. /*---创建默认配置的聊天室 ---  
  2.             先看看官方的文档:  
  3.             Creates a new multi user chat with the specified connection and room name. Note: no 
  4.                   * information is sent to or received from the server until you attempt to  
  5.                  * {@link #join(String) join} the chat room. On some server implementations, 
  6.                   * the room will not be created until the first person joins it  
  7.                  * 最重要一句:直到用户调用join方法的时候聊天室才会被创建  
  8.                  */   

写到这就差不多了,但是服务停止聊天室就没了,不是持久 的,后面还要在研究。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值