powered by Jive Software

IllegalArgumentException on connect() for wrong XmppDomain

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.(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)

Thanks for reporting. Should be fixed with Fix IllegalArgumentException on DNS lookup if XMPP domain is wrong · Flowdalic/Smack@f31cc6e · GitHub

You know the routine . I’ve uploaded a new snapshot of 4.2.0-rc2, please test and report back. Thank you.

Great! Thanks for fast fix!

Where you able to verify that it works as intended?

Yes, seems ok, thanks a lot!