我升級smack到4.2.0後,我得到連接問題。失敗,因爲:de.measite.minidns.hla.ResolutionUnsuccessfulException:詢問xxxx。 t IN t AAAA產生了一個錯誤響應NX_DOMAIN
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
當主機在連接配置生成器中設置時,會發生該問題。
例如:
.setHost(ServiceConstants.CHAT_SERVER)
見https://github.com/igniterealtime/Smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide
這是我的最終配置,它Davood Falahati幫助後,成功了!
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)
[錯誤上咂嘴4.2.0:IN AAAA產生錯誤響應NX \ _domain]的可能的複製( http://stackoverflow.com/questions/43143359/error-on-smack-4-2-0-in-aaaa-yielded-an-error-response-nx-domain) – Flow