commenting out
env.put(“java.naming.factory.initial”, “com.sun.jndi.dns.DnsContextFactory”);
below fixes the issue
public class JavaxResolver extends DNSResolver implements SmackInitializer {
private static JavaxResolver instance;
private static DirContext dirContext;
static {
try {
Hashtable<String, String> env = new Hashtable<>();
env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
dirContext = new InitialDirContext(env);
} catch (Exception e) {
// Ignore.
}
// Try to set this DNS resolver as primary one
setup();
}