From 97b5648d609c331fe9234aeaa68101dc6a8ae7ef Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Thu, 05 Jun 2008 15:09:30 +0000
Subject: [PATCH] Fix for issue 3318 (status-panel NullPointerException at com.sun.jndi.ldap.LdapClient.getSearchReply) There can be an exception generated from somewhere outside the status panel code, so instead of printing the stack trace log it to the log file.
---
opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java b/opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java
index 4e3418d..b1818d4 100644
--- a/opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java
+++ b/opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java
@@ -33,6 +33,8 @@
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
@@ -71,6 +73,8 @@
new HashMap<String, Integer>();
private HashMap<String, Long> hmAgeOfOldestMissingChanges =
new HashMap<String, Long>();
+ private static final Logger LOG = Logger.getLogger(
+ ConfigFromLDAP.class.getName());
private String dn;
private String pwd;
@@ -242,8 +246,9 @@
}
catch (Throwable t)
{
- // Bug
- t.printStackTrace();
+ // Bug: this is not necessarily a bug on our side (see issue 3318).
+ // Just log it.
+ LOG.log(Level.SEVERE, "Unexpected error reading configuration: "+t, t);
errorMessage = ERR_READING_CONFIG_LDAP.get(t.toString());
}
}
--
Gitblit v1.10.0