mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
13.48.2007 313c7ce226afaa79e811d6fa0f5ad8b8a59f0fd5
opends/src/server/org/opends/server/extensions/ConfigFileHandler.java
@@ -655,38 +655,11 @@
    }
    // Determine the appropriate server root for the Directory Server.  First,
    // do this by looking for a Java property.  If that isn't specified, then
    // look for an environment variable, and if all else fails then try to
    // figure it out from the location of the configuration file.
    String rootDirStr = System.getProperty(PROPERTY_SERVER_ROOT);
    if (rootDirStr == null)
    {
      rootDirStr = System.getenv(ENV_VAR_INSTANCE_ROOT);
    }
    if (rootDirStr != null)
    {
      try
      {
        File serverRootFile = new File(rootDirStr);
        serverRoot = serverRootFile.getAbsolutePath();
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        int    msgID   = MSGID_CONFIG_CANNOT_DETERMINE_SERVER_ROOT;
        String message = getMessage(msgID, ENV_VAR_INSTANCE_ROOT);
        throw new InitializationException(msgID, message);
      }
    }
    if (serverRoot == null)
    // Determine the appropriate server root.  If it's not defined in the
    // environment config, then try to figure it out from the location of the
    // configuration file.
    File rootFile = DirectoryServer.getEnvironmentConfig().getServerRoot();
    if (rootFile == null)
    {
      try
      {
@@ -725,6 +698,10 @@
        throw new InitializationException(msgID, message);
      }
    }
    else
    {
      serverRoot = rootFile.getAbsolutePath();
    }
    // Register with the Directory Server as an alert generator.