From: Luis Gomez Date: Wed, 13 Apr 2016 04:48:41 +0000 (-0700) Subject: Fix Java related issues X-Git-Tag: release/beryllium-sr2~42^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=releng%2Fbuilder.git;a=commitdiff_plain;h=039df5942bbaae09291d479d5db67a5e00cf5f75 Fix Java related issues Set controller java version in bin/setenv so that bin/start always works Set VM java version with alternatives so other java applications work too The above is set from variable ${JAVA_HOME} injected from bundle_vars.txt Change-Id: I25307c46e6c7435a6f8005eb22f7aa9a49c55351 Signed-off-by: Luis Gomez --- diff --git a/jjb/integration/include-raw-integration-configure-clustering.sh b/jjb/integration/include-raw-integration-configure-clustering.sh index ffe71eef4..764469951 100644 --- a/jjb/integration/include-raw-integration-configure-clustering.sh +++ b/jjb/integration/include-raw-integration-configure-clustering.sh @@ -71,13 +71,17 @@ cat ${MODULESCONF} echo "Dump module-shards.conf" cat ${MODULESHARDSCONF} +echo "Set Java version" +sudo /usr/sbin/alternatives --install /usr/bin/java java ${JAVA_HOME}/bin/java 1 +sudo /usr/sbin/alternatives --set java ${JAVA_HOME}/bin/java +echo "JDK default version ..." +java -version + echo "Set JAVA_HOME" export JAVA_HOME="${JAVA_HOME}" # Did you know that in HERE documents, single quote is an ordinary character, but backticks are still executing? JAVA_RESOLVED=\`readlink -e "\${JAVA_HOME}/bin/java"\` echo "Java binary pointed at by JAVA_HOME: \${JAVA_RESOLVED}" -echo "JDK default version ..." -java -version echo "Starting controller..." /tmp/${BUNDLEFOLDER}/bin/start diff --git a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh index 0f3d93f59..8d25ebb55 100644 --- a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh +++ b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh @@ -53,21 +53,26 @@ sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupInde sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=100GB/g' \${LOGCONF} cat \${LOGCONF} -echo "Configure max memory..." +echo "Configure java home and max memory..." MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv +sed -ie 's%^# export JAVA_HOME%export JAVA_HOME="\${JAVA_HOME:-${JAVA_HOME}}"%g' \${MEMCONF} sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' \${MEMCONF} cat \${MEMCONF} echo "Listing all open ports on controller system..." netstat -natu +echo "Set Java version" +sudo /usr/sbin/alternatives --install /usr/bin/java java ${JAVA_HOME}/bin/java 1 +sudo /usr/sbin/alternatives --set java ${JAVA_HOME}/bin/java +echo "JDK default version ..." +java -version + echo "Set JAVA_HOME" export JAVA_HOME="$JAVA_HOME" # Did you know that in HERE documents, single quote is an ordinary character, but backticks are still executing? JAVA_RESOLVED=\`readlink -e "\${JAVA_HOME}/bin/java"\` echo "Java binary pointed at by JAVA_HOME: \${JAVA_RESOLVED}" -echo "JDK default version ..." -java -version echo "Starting controller..." /tmp/${BUNDLEFOLDER}/bin/start diff --git a/jjb/integration/include-raw-integration-deploy-controller.sh b/jjb/integration/include-raw-integration-deploy-controller.sh index d9ac4da92..8db436d95 100644 --- a/jjb/integration/include-raw-integration-deploy-controller.sh +++ b/jjb/integration/include-raw-integration-deploy-controller.sh @@ -38,8 +38,9 @@ sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupInde sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=100GB/g' \${LOGCONF} cat \${LOGCONF} -echo "Configure max memory..." +echo "Configure java home and max memory..." MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv +sed -ie 's%^# export JAVA_HOME%export JAVA_HOME="\${JAVA_HOME:-${JAVA_HOME}}"%g' \${MEMCONF} sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' \${MEMCONF} cat \${MEMCONF} @@ -47,7 +48,7 @@ EOF for i in `seq 1 ${NUM_ODL_SYSTEM}` do - CONTROLLERIP=ODL_SYSTEM_${i}_IP + CONTROLLERIP=ODL_SYSTEM_${i}_IP echo "Installing distribution in member-${i} with IP address ${!CONTROLLERIP}" scp ${WORKSPACE}/deploy-controller-script.sh ${!CONTROLLERIP}:/tmp ssh ${!CONTROLLERIP} 'bash /tmp/deploy-controller-script.sh'