OPENDJ-1635 SNMP: fail to get dsServerDescription value
SNMP's dsServerDescription determines the install path from the location of bootstrap-client.jar, extracted from the class path.
However, start-ds command uses bootstrap.jar in the classpath instead of bootstrap-client.jar (which is for the tools).
The fix consists in verifying the location for both boostrap.jar and boostrap-client.jar in the classpath.
Installation.java:
Changed OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH to refer to bootstrap.jar.
Added OPENDJ_BOOTSTRAP_CLIENT_JAR_RELATIVE_PATH constant.
Utils.java, Utilities.java:
In getInstallPath(), added checks for both OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH and OPENDJ_BOOTSTRAP_CLIENT_JAR_RELATIVE_PATH.
| | |
| | | |
| | | import static org.opends.admin.ads.util.ConnectionUtils.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.quicksetup.Installation.*; |
| | | import static org.opends.server.types.CommonSchemaElements.*; |
| | | |
| | | /** |
| | |
| | | { |
| | | for (String classPath : classPaths) |
| | | { |
| | | String normPath = classPath.replace(File.separatorChar, '/'); |
| | | if (normPath.endsWith(Installation.OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH)) |
| | | final String normPath = classPath.replace(File.separatorChar, '/'); |
| | | if (normPath.endsWith(OPENDJ_BOOTSTRAP_CLIENT_JAR_RELATIVE_PATH) |
| | | || normPath.endsWith(OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH)) |
| | | { |
| | | return classPath; |
| | | } |
| | |
| | | { |
| | | |
| | | /** Relative path to bootstrap OpenDJ jar file. */ |
| | | public static final String OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH = |
| | | "lib/bootstrap-client.jar"; |
| | | public static final String OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH = "lib/bootstrap.jar"; |
| | | /** Relative path to bootstrap-client OpenDJ jar file. */ |
| | | public static final String OPENDJ_BOOTSTRAP_CLIENT_JAR_RELATIVE_PATH = "lib/bootstrap-client.jar"; |
| | | |
| | | /** |
| | | * The relative path where all the Windows binaries (batch files) are. |
| | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.admin.ads.util.ConnectionUtils.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import static org.opends.quicksetup.Installation.*; |
| | | import static org.opends.server.util.DynamicConstants.*; |
| | | |
| | | /** |
| | |
| | | for (String classPath : classPaths) |
| | | { |
| | | final String normPath = classPath.replace(File.separatorChar, '/'); |
| | | if (normPath.endsWith(Installation.OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH)) |
| | | if (normPath.endsWith(OPENDJ_BOOTSTRAP_CLIENT_JAR_RELATIVE_PATH) |
| | | || normPath.endsWith(OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH)) |
| | | { |
| | | return classPath; |
| | | } |