diff --git a/smack-resolver-javax/src/main/java/org/jivesoftware/smack/util/dns/javax/JavaxResolver.java b/smack-resolver-javax/src/main/java/org/jivesoftware/smack/util/dns/javax/JavaxResolver.java
index <HASH>..<HASH> 100644
--- a/smack-resolver-javax/src/main/java/org/jivesoftware/smack/util/dns/javax/JavaxResolver.java
+++ b/smack-resolver-javax/src/main/java/org/jivesoftware/smack/util/dns/javax/JavaxResolver.java
@@ -52,7 +52,7 @@ public class JavaxResolver extends DNSResolver implements SmackInitializer {
     static {
         try {
             dirContext = new InitialDirContext();
-        } catch (Exception e) {
+        } catch (NamingException e) {
             LOGGER.log(Level.SEVERE, "Could not construct InitialDirContext", e);
         }
Reduce scope of catched Exceptions in JavaxResolver