summaryrefslogtreecommitdiffstats
path: root/base/server/cms/src/com
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-09-19 22:54:51 +0200
committerEndi S. Dewata <edewata@redhat.com>2016-09-20 02:28:24 +0200
commitefc88b134f3f188c43b3bec978e9d19fd297df70 (patch)
tree96d7c2a04dfcfc4a8cf374f4df1adeb2aea59e67 /base/server/cms/src/com
parent15e2524c612184116763e36d5b91128662cf8006 (diff)
downloadpki-efc88b134f3f188c43b3bec978e9d19fd297df70.tar.gz
pki-efc88b134f3f188c43b3bec978e9d19fd297df70.tar.xz
pki-efc88b134f3f188c43b3bec978e9d19fd297df70.zip
Troubleshooting improvements for ConfigurationUtils.
To help troubleshooting the ConfigurationUtils has been modified to chain the original exceptions and to show additional log messages. https://fedorahosted.org/pki/ticket/2463
Diffstat (limited to 'base/server/cms/src/com')
-rw-r--r--base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
index cdb284495..92a901791 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
@@ -371,10 +371,15 @@ public class ConfigurationUtils {
String body = post(sdhost, sdport, true, "/ca/admin/ca/getCookie",
content, null, null);
+ CMS.debug("ConfigurationUtils: response: " + body);
+
return getContentValue(body, "header.session_id");
}
public static String getContentValue(String body, String header) {
+
+ CMS.debug("ConfigurationUtils: searching for " + header);
+
StringTokenizer st = new StringTokenizer(body, "\n");
while (st.hasMoreTokens()) {
@@ -994,7 +999,7 @@ public class ConfigurationUtils {
cm.findCertByNickname(nickname);
} catch (ObjectNotFoundException e) {
- throw new Exception("Missing system certificate: " + nickname);
+ throw new Exception("Missing system certificate: " + nickname, e);
}
}
}
@@ -1679,7 +1684,7 @@ public class ConfigurationUtils {
CMS.debug("checkParentExists: Parent entry " + parentDN + " exists.");
} catch (LDAPException e) {
if (e.getLDAPResultCode() == LDAPException.NO_SUCH_OBJECT) {
- throw new EBaseException("Parent entry " + parentDN + "does not exist", e);
+ throw new EBaseException("Parent entry " + parentDN + " does not exist", e);
} else {
CMS.debug("checkParentExists: " + e);
throw new EBaseException("Failed to determine if base DN exists: " + e, e);
@@ -2320,7 +2325,7 @@ public class ConfigurationUtils {
public static KeyPair loadKeyPair(String nickname, String token) throws Exception {
- CMS.debug("ConfigurationUtils: loadKeyPair(" + nickname + ")");
+ CMS.debug("ConfigurationUtils: loadKeyPair(" + nickname + ", " + token + ")");
CryptoManager cm = CryptoManager.getInstance();
@@ -3376,12 +3381,12 @@ public class ConfigurationUtils {
try {
@SuppressWarnings("unused")
boolean done = cs.getBoolean("preop.CertRequestPanel.done"); // check for errors
- } catch (Exception ee) {
+ } catch (Exception e) {
if (hardware) {
CMS.debug("ConfigurationUtils: findCertificate: The certificate with the same nickname: "
+ fullnickname + " has been found on HSM. Please remove it before proceeding.");
throw new IOException("The certificate with the same nickname: "
- + fullnickname + " has been found on HSM. Please remove it before proceeding.");
+ + fullnickname + " has been found on HSM. Please remove it before proceeding.", e);
}
}
return true;
@@ -4510,7 +4515,7 @@ public class ConfigurationUtils {
if (response == null || response.equals("")) {
CMS.debug("exportTransportCert: response is empty or null.");
- throw new IOException("The server " + targetURI + "is not available");
+ throw new IOException("The server " + targetURI + " is not available");
} else {
ByteArrayInputStream bis = new ByteArrayInputStream(response.getBytes());
XMLObject parser = new XMLObject(bis);