1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 14:22:05 +01:00

Do not set com.sun.jndi.dns.DnsContextFactory in JavaxResolver

as this is not accessible in newer Java versions (at least 11).

Fixes SMACK-856.
This commit is contained in:
Florian Schmaus 2019-02-16 10:00:11 +01:00
parent 78dcaec75b
commit ac9641f091

View file

@ -1,6 +1,6 @@
/** /**
* *
* Copyright 2013-2018 Florian Schmaus * Copyright 2013-2019 Florian Schmaus
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -18,7 +18,6 @@ package org.jivesoftware.smack.util.dns.javax;
import java.net.InetAddress; import java.net.InetAddress;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
@ -52,9 +51,7 @@ public class JavaxResolver extends DNSResolver implements SmackInitializer {
static { static {
try { try {
Hashtable<String, String> env = new Hashtable<>(); dirContext = new InitialDirContext();
env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
dirContext = new InitialDirContext(env);
} catch (Exception e) { } catch (Exception e) {
// Ignore. // Ignore.
} }