AnsweredAssumed Answered

IllegalArgumentException on connect() for wrong XmppDomain

Question asked by Grigory Fedorov on Jan 12, 2017
Latest reply on Jan 14, 2017 by Grigory Fedorov

Very similar issue to IllegalArgumentException for wrong custom host

 

I use latest Smack-4.2-RC1-SNAPSHOT on Android.

I build connection using setXmppDomain and then call "connect". If I set nonexistent domain (e.g. wrong user input) I get IllegalArgumentException:

java.lang.IllegalArgumentException: Must provide at least one InetAddress

     at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:55)

     at org.jivesoftware.smack.util.dns.DNSResolver.lookupHostAddress(DNSResolver.java: 56)

     at org.jivesoftware.smack.util.DNSUtil.resolveDomain(DNSUtil.java:209)

     at org.jivesoftware.smack.util.DNSUtil.resolveXMPPServiceDomain(DNSUtil.java:136)

     at org.jivesoftware.smack.AbstractXMPPConnection.populateHostAddresses(AbstractXMP PConnection.java:626)

     at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPC onnection.java:556)

     at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection. java:888)

     at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.ja va:377)

Outcomes