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

Fabio Pistolesi
05.42.2016 e54deb8b792b9b16880f7e3c3783aa0c620d1721
Display more information about errors while reading server information
2 files modified
8 ■■■■■ changed files
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/BuildVersion.java 6 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/resources/com/forgerock/opendj/ldap/config/config.properties 2 ●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/BuildVersion.java
@@ -17,6 +17,7 @@
package org.forgerock.opendj.config.dsconfig;
import static com.forgerock.opendj.ldap.config.ConfigMessages.*;
import static com.forgerock.opendj.util.StaticUtils.stackTraceToSingleLineString;
import static org.forgerock.util.Utils.closeSilently;
import java.io.BufferedReader;
@@ -24,6 +25,7 @@
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.NoSuchElementException;
import org.forgerock.opendj.config.ConfigurationFramework;
import org.forgerock.opendj.config.server.ConfigException;
@@ -76,8 +78,8 @@
        try {
            final SearchResultEntry entry = connection.readEntry("", "fullVendorVersion");
            return valueOf(entry.getAttribute("fullVendorVersion").firstValueAsString());
        } catch (LdapException e) {
            throw new ConfigException(ERR_CONFIGVERSION_NOT_FOUND.get());
        } catch (NullPointerException | NoSuchElementException |LdapException e) {
            throw new ConfigException(ERR_CONFIGVERSION_NOT_FOUND.get(stackTraceToSingleLineString(e, false)));
        }
    }
opendj-config/src/main/resources/com/forgerock/opendj/ldap/config/config.properties
@@ -176,4 +176,4 @@
ERR_BUILDVERSION_NOT_FOUND_737=The version of the installed OpenDJ could not be determined \
because the version file '%s' could not be found. Restore it from backup before continuing
ERR_CONFIGVERSION_NOT_FOUND_738=The version of the installed OpenDJ could not be determined \
because an error occurs during reading the current configuration.
because an error occurred while reading the current configuration: %s