0

我正在使用 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)
4

2 回答 2

0

要创建房间,请在您的电脑中安装 spark 并使用 openfire 用户帐户登录,然后从那里创建房间,您将获得

yourroomname@coneference.storege

就我而言,我得到了这个。所以现在我尝试通过我的应用程序创建房间并将服务器名称命名为

会议存储

和组名。我的组创建成功。创建房间时请不要提供IP地址。

于 2016-01-28T06:22:25.717 回答
0

您正在尝试myroom在会议服务器上创建房间conference.192.168.1.4,但作为回报,您会收到remote-server-not-found错误消息。

服务器名称conference.192.168.1.4看起来很奇怪,因为它是主机名和 IP 地址的混合。您需要通过检查其配置或(如果会议服务器作为您要连接的服务器的组件运行)通过执行“项目”服务发现请求来确定实际调用的会议服务器。

我对 Tigase 不熟悉,但它的 MUC 服务似乎包含在一个单独的组件中。您可能需要检查它是否已正确安装和启动。

于 2016-01-22T11:24:46.003 回答