i am getting a error when trying to register a user using smack api(4.2) on android device on ejabberd (17.07)

落爺英雄遲暮 提交于 2019-12-24 05:04:41

问题


I tried to find the reason of the error but cannot found it. If anyone can suggest a way it will be highly appreciated.

Earlier I was using ejabberd version 2.1 with default mnesia, which was working fine. I was able to register users from the android app.

But now when I installed new ejabberd 17.07 with mysql, it gave me error as follow:

Connection XMPPTCPConnection[not-authenticated] (5) closed with error
org.jivesoftware.smack.XMPPException$StreamErrorException: not-authorized You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1046)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:980)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:996)
at java.lang.Thread.run(Thread.java:818)
 E/ExceptionException: org.jivesoftware.smack.SmackException$NotConnectedException: The connection XMPPTCPConnection[not-authenticated] (5) is no longer connected while waiting for response with StanzaIdFilter: id=jq6OD-18

回答1:


its because the user or ip doesn't have the privilege to register new user.You need to do few things for that. Enable mod_register

mod_register: access_from: all access: register

. Make sure your ip blocking is not enabled.Also check access_rules that register: - allow

is not commented.



来源:https://stackoverflow.com/questions/45294682/i-am-getting-a-error-when-trying-to-register-a-user-using-smack-api4-2-on-andr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!