File serverLocation = new File(serverLocationString);
Installation.validateRootDirectory(serverLocation);
// If we get here the value is acceptable and not null
Installation currentInstallation = getInstallation();
if (currentInstallation == null ||
!serverLocation.equals(getInstallation().getRootDirectory())) {
LOG.log(Level.INFO,
"user changed server root from " +
(currentInstallation == null ?
"'null'" :
currentInstallation.getRootDirectory()) +
" to " + serverLocation);
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
// NASUTEKDS_JAVA_HOME in the message there is an error with the
// script.
if (ae.getMessageObject().toString().indexOf(
"NASUTEKDS_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,