From c5f88120ad601b099ab51a451b8bc4bf24d5391f Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 20 Jan 2009 11:33:46 +0000
Subject: [PATCH] Fix for issue 3131 (Windows: upgrade using the webinstaller should not hang) Detect that the java arguments used in the installation are not compatible with the JVM of the web start installer and display an error message accordingly.
---
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java | 42 +++++++++++++++++++++++++++++++++++++-----
1 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java b/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
index 30d55f0..875a6b4 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -215,11 +215,6 @@
private BuildInformation stagedVersion = null;
/**
- * Information on the staged instance.
- */
- private BuildInformation stagedInstanceVersion = null;
-
- /**
* New OpenDS bits.
*/
private Installation stagedInstallation = null;
@@ -661,6 +656,43 @@
Installation installation = new Installation(serverLocation,
serverLocation);
setInstallation(installation);
+ try
+ {
+ // Try to see if there is a problem with the build information,
+ // we might be trying to do the upgrade with a JVM that is not
+ // compatible with the java arguments used by the server
+ // scripts (see issue ).
+ installation.getBuildInformation(true);
+ }
+ catch (ApplicationException ae)
+ {
+ if (ae.getMessageObject().getDescriptor().equals(
+ INFO_ERROR_CREATING_BUILD_INFO_MSG))
+ {
+ // This is the message thrown when there was a problem with
+ // the binary. The details content is on the scripts and not
+ // localized, we can assume that if there is a mention to
+ // OPENDS_JAVA_HOME in the message there is an error with the
+ // script.
+ if (ae.getMessageObject().toString().indexOf(
+ "OPENDS_JAVA_HOME") != -1)
+ {
+ String javaBin = System.getProperty("java.home")+
+ File.separator+
+ "bin"+File.separator+"java";
+ String setJavaHome =
+ installation.getSetJavaHomeFile().getAbsolutePath();
+ String dsJavaProperties =
+ installation.getJavaPropertiesCommandFile().
+ getAbsolutePath();
+ errorMsgs.add(ERR_INVALID_JAVA_ARGS.get(
+ serverLocationString,
+ javaBin,
+ setJavaHome,
+ dsJavaProperties));
+ }
+ }
+ }
}
uud.setServerLocation(serverLocationString);
--
Gitblit v1.10.0