From 200523633bec64d495c6f1a4003a191c3d9d1807 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 25 Sep 2007 08:49:02 +0000
Subject: [PATCH] Only seed the ads truststore when the ADS were not already replicated.  This avoids a NullPointerException when we enable replication on a baseDN between two servers and another baseDN was already being replicated.

---
 opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java b/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java
index 9c74d3e..7e785e8 100644
--- a/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java
+++ b/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java
@@ -3025,17 +3025,20 @@
           ERR_REPLICATION_UPDATING_ADS.get(adce.getMessage()),
           ERROR_UPDATING_ADS, adce);
     }
-    try
+    if (!adsAlreadyReplicated)
     {
-      ServerDescriptor.seedAdsTrustStore(ctxDestination,
-        adsCtxSource.getTrustedCertificates());
-    }
-    catch (Throwable t)
-    {
-      LOG.log(Level.SEVERE, "Error seeding truststores: "+t, t);
-      throw new ReplicationCliException(
-          ERR_REPLICATION_ENABLE_SEEDING_TRUSTSTORE.get(t.toString()),
-          ERROR_SEEDING_TRUSTORE, t);
+      try
+      {
+        ServerDescriptor.seedAdsTrustStore(ctxDestination,
+            adsCtxSource.getTrustedCertificates());
+      }
+      catch (Throwable t)
+      {
+        LOG.log(Level.SEVERE, "Error seeding truststores: "+t, t);
+        throw new ReplicationCliException(
+            ERR_REPLICATION_ENABLE_SEEDING_TRUSTSTORE.get(t.toString()),
+            ERROR_SEEDING_TRUSTORE, t);
+      }
     }
     printProgressMessage(formatter.getFormattedDone());
     printProgressMessage(formatter.getLineBreak());

--
Gitblit v1.10.0