ejabberd搜索-模块无法处理查询

时间:2018-07-23 11:57:40

标签: search ejabberd smack vcard

我正在使用此代码在ejabberd中搜索用户:

BareJid bareJid = JidCreate.bareFrom(_user_name + "@domain");
UserSearchManager sm = MainService.getUserSearchManager();
DomainBareJid sDomain = sm.getSearchServices().get(0);
Form form = sm.getSearchForm(sDomain).createAnswerForm();
form.setAnswer("user",_user_name);
ReportedData reportedData = sm.getSearchResults(form, sDomain);

但是我得到了这个错误:

<iq from='vjud.mnyr' id='jeRII-100' to='admin@mnyr/rsrc' type='error' xml:lang='en'>
    <query xmlns='jabber:iq:search'>
        <x type='submit' xmlns='jabber:x:data'>
            <field type='text-single' var='user'>
                <value>1*</value>
            </field>
        </x>
    </query>
    <error code='500' type='wait'>
        <internal-server-error xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' />
        <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='en'>Module failed to handle the query
        </text>
    </error>
</iq>

并在日志中:

Reason = {error,{{case_clause,undefined},[{io_lib_pretty,cind_rec,6,[{file,"io_lib_pretty.erl"},{line,813}]},{io_lib_pretty,cind_record,8,[{file,"io_lib_pretty.erl"},{line,765}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,849}]},{io_lib_pretty,cind_list,7,[{file,"io_lib_pretty.erl"},{line,819}]},{io_lib_pretty,cind_field,7,[{file,"io_lib_pretty.erl"},{line,795}]},{io_lib_pretty,cind_fields_tail,8,[{file,"io_lib_pretty.erl"},{line,779}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,849}]},{io_lib_pretty,cind_list,7,[{file,"io_lib_pretty.erl"},{line,819}]}]}}

请帮助我。我在MacOS上使用XmppFramework和Smack v4使用Ejabberd v18.0.6。

1 个答案:

答案 0 :(得分:2)

我可以轻松地重现该问题。这是一个小错误,现在我已在此提交中修复: https://github.com/processone/ejabberd/commit/1be21126342d503205798605725ba5ceef9de42b

感谢评论!