我正在使用以下代码创建多用户组,但遇到超时错误,即使超时错误为10秒也是如此。

public void createGroup() {

    String roomId = "Group_test003" + "@icoveri.com";
    String nick = "Grouptest";

    try {

        MultiUserChatManager manager = multiUserChatManager.getInstanceFor(connection);

        MultiUserChat muc = manager.getMultiUserChat(roomId);

        muc.create(nick);

        Form form = muc.getConfigurationForm();

        Form submitForm = form.createAnswerForm();

        List<FormField> fields = form.getFields();
        for (int i = 0; i < fields.size(); i++) {
            FormField field = (FormField) fields.get(i);
            if (!FormField.Type.hidden.equals(field.getType()) && field.getVariable() != null) {

                submitForm.setDefaultAnswer(field.getVariable());
            }
        }

        List owners = new ArrayList();
        owners.add(user1234 + "@icoveri.com");
        submitForm.setAnswer("muc#roomconfig_roomowners", owners);

        muc.sendConfigurationForm(submitForm);

    } catch (XMPPException e) {
        e.printStackTrace();
    } catch (SmackException.NoResponseException e) {
        e.printStackTrace();
    } catch (SmackException.NotConnectedException e) {
        e.printStackTrace();
    } catch (SmackException e) {
        e.printStackTrace();
    }

}


我得到的错误是


  org.jivesoftware.smack.SmackException $ NoResponseException:无响应
  在回复超时内收到。超时时间为10000毫秒(约10秒)。用过的
  过滤器:AndFilter:(FromMatchesFilter(完整):
  Group_test003 @ iscoveri.com / Grouptest,StanzaTypeFilter:
  org.jivesoftware.smack.packet.Presence)。
  
  在
  org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:229)
  在
  org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:311)
  在
  org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:400)
  在
  org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:376)

最佳答案

我有解决方案。问题出在我的服务即iscoveri.com。我必须使用其他服务名称来创建组。

07-24 09:26