From 43ba6d721185f9a810761720fcb05103b31d17b7 Mon Sep 17 00:00:00 2001
From: chebrard <chebrard@localhost>
Date: Wed, 29 Oct 2008 10:39:44 +0000
Subject: [PATCH] Fix 3534: Provide native Solaris packages (fix also 3533: upgrade fails starting server adding entry ds-cfg-key-id)

---
 opends/src/server/org/opends/server/admin/ClassLoaderProvider.java |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/opends/src/server/org/opends/server/admin/ClassLoaderProvider.java b/opends/src/server/org/opends/server/admin/ClassLoaderProvider.java
index dd640cf..99cb790 100644
--- a/opends/src/server/org/opends/server/admin/ClassLoaderProvider.java
+++ b/opends/src/server/org/opends/server/admin/ClassLoaderProvider.java
@@ -315,7 +315,18 @@
 
     // Put extensions jars into the class loader and load all
     // configuration definition classes in that they contain.
-    initializeAllExtensions();
+    // First load the extension from the install directory, then
+    // from the instance directory.
+    File libDir ;
+    File extensionsPath ;
+
+    libDir = new File(DirectoryServer.getServerRoot(),LIB_DIR);
+    extensionsPath = new File(libDir, EXTENSIONS_DIR);
+    initializeAllExtensions(extensionsPath);
+
+    libDir = new File(DirectoryServer.getInstanceRoot(),LIB_DIR);
+    extensionsPath = new File(libDir, EXTENSIONS_DIR);
+    initializeAllExtensions(extensionsPath);
   }
 
 
@@ -508,6 +519,7 @@
   /**
    * Put extensions jars into the class loader and load all
    * configuration definition classes in that they contain.
+   * @param extensionsPath Indicates where extensions are located.
    *
    * @throws InitializationException
    *           If the extensions folder could not be accessed or if a
@@ -515,10 +527,8 @@
    *           the configuration definition classes could not be
    *           initialized.
    */
-  private void initializeAllExtensions()
+  private void initializeAllExtensions(File extensionsPath)
       throws InitializationException {
-    File libPath = new File(DirectoryServer.getInstanceRoot(), LIB_DIR);
-    File extensionsPath = new File(libPath, EXTENSIONS_DIR);
 
     try {
       if (!extensionsPath.exists()) {

--
Gitblit v1.10.0