powered by Jive Software

IllegalArgumentException for wrong custom host

I set host using XMPPTCPConnectionConfiguration.Builder.setHost

If host is wrong, I’ve got IllegalArgumentException:

W/System.err: java.lang.IllegalArgumentException: Must provide at least one InetAddress

W/System.err: at org.jivesoftware.smack.util.dns.HostAddress.(HostAddress.java:55)

W/System.err: at org.jivesoftware.smack.util.dns.DNSResolver.lookupHostAddress(DNSResolver.java: 56)

W/System.err: at org.jivesoftware.smack.AbstractXMPPConnection.populateHostAddresses(AbstractXMP PConnection.java:618)

W/System.err: at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPC onnection.java:556)

W/System.err: at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection. java:887)

W/System.err: at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.ja va:377)

So, I configure connection, call “connect” and get unexpected IllegalArgumentException.

Should it be a kind of IOException or SmackException?

Using Smack 4.2.0-RC2-SNAPHOT

Thanks for reporting. By wrong you mean like a non existent domain?

Yes, for example, user can enter any hostname.

This is using Smack on Android, right? So smack-resolver-minidns is active?

Yes, I use Smack on Android. Yes, MiniDnsResolver is active.

Fixed with Ensure that populateHostAddressees() doesn’t return a list with ‘null’ · igniterealtime/Smack@b0fef6f · GitHub and upload a new version of 4.2.0-rc2-SNAPSHOT.

Thanks again for reporting!

Thansk! Tested with updated snapshot - looks better now!