CDV ❯ dso-env.bat should not modify or set non TC env vars
-
Bug
-
Status: Open
-
2 Major
-
Resolution:
-
-
-
prodmgmt
-
Reporter: gbevin
-
April 10, 2008
-
0
-
Watchers: 0
-
March 19, 2010
-
Description
(note, that this is for the book, so that a simple example can be presented to the user about how to integrate Terracotta in an existing Tomcat installation, so it’s rather urgent)
I’ve been trying to get Terracotta to work easily on Windows with an existing Tomcat installation. For that I create a setenv.bat file in the bin dir with these instructions:
set TC_INSTALL_DIR=”C:\terracotta-2.7.0-snapshot” set TC_CONFIG_PATH=”localhost:9510” call %TC_INSTALL_DIR%\bin\dso-env.bat -q set JAVA_OPTS=%TC_JAVA_OPTS% %JAVA_OPTS%
With this, Tomcat fails to startup due to an error while running their setclasspath.bat file.
I tracked this down to our boot-jar-path.bat script (which is used by dso-env.bat) that always surrounds an existing JAVA_HOME env variable with double quotes. This causes the line
if not "%JAVA_HOME%" == "" goto gotJdkHome
to fail in setclasspath.bat of Tomcat.
The reason is the following line from boot-jar-path.bat:
set JAVA_HOME="%JAVA_HOME:"=%"
I think that dso-env.bat should have no side-effects at all on existing non-Terracotta environment variables. It’s also weird that JAVA_HOME is by default set in boot-jar-path.bat to the JRE that ships with Terracotta for the entire environment, if it wasn’t there before. That makes using dso-env.bat a lot less appealing.
More discussion about it here: http://lists.terracotta.org/pipermail/tc-dev/2008-April/002661.html
Taylor/Steve to have a meeting with Juris to discuss impact of changing.