我使用smack库使用android应用程序来装箱。
以下是使用muc创建群组聊天(会议室)的代码:
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
muc = manager.getMultiUserChat("myroom@conference.192.168.1.4");
muc.create("myroom");
muc.sendConfigurationForm(new Form(DataForm.Type.submit));
以下是在MUC中执行上述创建组命令时的日志:
<presence to='myroom@conference.192.168.1.4/myroom' id='wvAb9-11'><x xmlns='http://jabber.org/protocol/muc'></x><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.igniterealtime.org/projects/smack' ver='NfJ3flI83zSdUDzCEICtbypursw='/></presence>
<presence type="error" xmlns="jabber:client" id="wvAb9-11" from="myroom@conference.192.168.1.4/myroom" to="dk@yama/Smack"><x xmlns="http://jabber.org/protocol/muc"/><c xmlns="http://jabber.org/protocol/caps" node="http://www.igniterealtime.org/projects/smack" hash="sha-1" ver="NfJ3flI83zSdUDzCEICtbypursw="/><error type="cancel" code="404"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">S2S - destination host not found</text></error></presence>
org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPPError: remote-server-not-found - cancel
at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:232)
at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:311)
at org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:400)
at org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:376)
<presence to='myroom@conference.192.168.1.4/myroom' id='wvAb9-11'><x xmlns='http://jabber.org/protocol/muc'></x><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.igniterealtime.org/projects/smack' ver='NfJ3flI83zSdUDzCEICtbypursw='/></presence>
<presence type="error" xmlns="jabber:client" id="wvAb9-11" from="myroom@conference.192.168.1.4/myroom" to="dk@yama/Smack"><x xmlns="http://jabber.org/protocol/muc"/><c xmlns="http://jabber.org/protocol/caps" node="http://www.igniterealtime.org/projects/smack" hash="sha-1" ver="NfJ3flI83zSdUDzCEICtbypursw="/><error type="cancel" code="404"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">S2S - destination host not found</text></error></presence>
org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPPError: remote-server-not-found - cancel
at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:232)
at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:311)
at org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:400)
at org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:376)
at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:354)
at com.example.sufalam.tigasechatdemo.UserListActivity$3.onClick(UserListActivity.java:72)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:354)
at com.example.sufalam.tigasechatdemo.UserListActivity$3.onClick(UserListActivity.java:72)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
答案 0 :(得分:0)
您正在尝试在会议服务器myroom
上创建会议室conference.192.168.1.4
,但作为回报,您会收到remote-server-not-found
错误。
服务器名称conference.192.168.1.4
看起来很奇怪,因为它是主机名和IP地址的混合。您需要通过检查其配置来确定会议服务器的实际调用内容,或者(如果会议服务器作为您要连接的服务器的一个组件运行)performing an "items" service discovery request。
我不熟悉Tigase,但它的MUC服务似乎是separate component。您可能需要检查它是否已正确安装和启动。
答案 1 :(得分:0)
要创建空间,请在您的电脑上安装spark并使用openfire用户帐户登录,然后从那里创建房间,您将获得
在我的情况下,我得到了这个。所以现在我尝试通过我的应用程序创建空间并将服务器名称设为yourroomname@coneference.storege
coneference.storege
和组名。我的小组创建成功。请不要在创建房间时提供IP地址。