failed because: de.measite.minidns.hla.ResolutionUnsuccessfulException: Asking for xxxx. IN AAAA yielded an error response NX_DOMAIN

我只是一个虾纸丫 提交于 2019-12-08 17:28:34

问题


After I upgraded smack to 4.2.0 I am getting connection issue.

The following addresses failed: 'xxxx:5222' failed because: 

de.measite.minidns.hla.ResolutionUnsuccessfulException: Asking for xxxx.    IN  A yielded an error response NX_DOMAIN, '52.90.233.38:5222' failed because: de.measite.minidns.hla.ResolutionUnsuccessfulException: Asking for xxxx. IN  AAAA yielded an error response NX_DOMAIN

the issue happen when host is set in connection configuration builder.

example :

.setHost(ServiceConstants.CHAT_SERVER)

See https://github.com/igniterealtime/Smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide

This is my final configuration, it worked after Davood Falahati help !

InetAddress inetAddress = InetAddress.getByName(ServiceConstants.CHAT_SERVER);
            XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder()
                    .setXmppDomain(JidCreate.from(ServiceConstants.CHAT_SERVER).asDomainBareJid())
                    .setPort(5222)
                    .setHostAddress(inetAddress)
                    .setDebuggerEnabled(true)
                    .setSendPresence(true)

回答1:


This problem mainly occurs in local networks when the xmpp server is not configured in local DNS. To solve the problem, explicitly address the xmpp server and use

setHostAddress(InetAddress address)

see my answer here



来源:https://stackoverflow.com/questions/43160061/failed-because-de-measite-minidns-hla-resolutionunsuccessfulexception-asking-f

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