I'd like to submit a patch for the Geronimo 2.1.3 release, attached.
I was not seeing consistent usage in the shell scripts of the
following:
- GERONIMO_HOME
- GERONIMO_BASE
- org.apache.geronimo.base.dir
In 4 of the scripts, GERONIMO_BASE was used where GERONIMO_HOME
should have been used, or GERONIMO_BASE should be used to complete
the path to the temp file, otherwise the GeronimoInstallationPath is
used to complete the temp file path.
The attached patch corrects these.
For more information, please see my thread on [EMAIL PROTECTED]
Subject: GERONIMO_BASE vs. GERONIMO_HOME and
org.apache.geronimo.base.dir
And as an additional note, this patch resolves a few errors, but not
this one:
-
Using GERONIMO_BASE: /usr/local/geronimo/server1
Using GERONIMO_HOME: /usr/local/geronimo
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME: /usr/jdk1.5.0_07/jre
10:45:33,914 ERROR [LocalAttributeManager] Caught exception
java.io.FileNotFoundException: /usr/local/geronimo-jetty6-
javaee5-2.1.1/var/config/config-substitutions.properties (No such
file or directory) trying to open properties file /usr/local/
geronimo-jetty6-javaee5-2.1.1/var/config/config-
substitutions.properties
-
Geronimo looks for the 'var/config/config-substitutions.properties'
file according to 'org.apache.geronimo.server.dir' variable.
However the bin/geronimo.sh script only sets -
Dorg.apache.geronimo.base.dir=$GERONIMO_BASE
But I do not see how org.apache.geronimo.base.dir is used inside
Geronimo.
To fix we would have to set the variable -
Dorg.apache.geronimo.server.dir=$GERONIMO_BASE too - but we cannot
do that if we want users to be able to supply the -
Dorg.apache.geronimo.server.name=<relative_path> variable outside of
bin/geronimo.sh in $GERONIMO_OPTS env var.
-
So I could not figure out a good way to address this error, unless
we overrided org.apache.geronimo.base.dir variable with whatever is
in the org.apache.geronimo.server.dir variable, then change Geronimo
to look for the configSubstitutionFile as
'<org.apache.geronimo.base.dir>/var/config/config-
substitutions.properties'
And it appears that Geronimo ignores org.apache.geronimo.base.dir in
favor of org.apache.geronimo.home.dir anyway, so removing the
configured org.apache.geronimo.base.dir property in bin/geronimo.sh
does not seem to hurt anything - at first test, at least, it works
for me.
Then we just always set org.apache.geronimo.base.dir =
org.apache.geronimo.server.dir
-
I would appreciate if someone shed light on the proper intended
usage of the org.apache.geronimo.base.dir property.
-
How To Produce The Errors the attached patch fixes:
<perform>
1) expand geronimo-jetty6-javaee5-2.1.2 in /usr/local/
2) cd /usr/local; ln -s geronimo-jetty6-javaee5-2.1.2 geronimo
2) create the directory /usr/local/geronimo/server1
3) move /usr/local/geronimo/var to /usr/local/geronimo/server1/var
4) start geronimo with this shell command:
-
cd /usr/local/geronimo
export GERONIMO_HOME=/usr/local/geronimo
export GERONIMO_BASE=/usr/local/geronimo/server1
exec ${GERONIMO_HOME}/bin/startup.sh
-
</perform>
<error>
$ tail -1 /usr/local/geronimo/server1/var/log/geronimo.out
The java.io.tmpdir system property specifies a non-existent
directory: /usr/local/geronimo-jetty6-javaee5-2.1.2/var/temp
-
read: /usr/local/geronimo/bin/geronimo.sh
# GERONIMO_TMPDIR (Optional) Directory path location of temporary
directory
# the JVM should use (java.io.tmpdir).
# Defaults to $GERONIMO_BASE/var/temp.
if [ -z "$GERONIMO_TMPDIR" ] ; then
# Define the java.io.tmpdir to use for Geronimo
# A relative value will be resolved relative to each instance
GERONIMO_TMPDIR=var/temp
fi
-
This is incorrect documentation, as the error message illustrates.
GERONIMO_TMPDIR does not default to $GERONIMO_BASE/var/temp
Nor does it default to $GERONIMO_HOME/var/temp
Instead: It defaults to <Geronimo_install_directory>/var/temp
Or also org.apache.geronimo.server.dir/var/temp
GERONIMO_TMPDIR should be set with $GERONIMO_BASE/var/temp
</error>
<error>
$ cat /usr/local/geronimo/server1/var/log/geronimo.out | grep '\
[java.*.dirs\]'
/usr/jdk1.5.0_07/jre/lib/i386/client:/usr/jdk1.5.0_07/jre/lib/i386:/
usr/jdk1.5.0_07/jre/../lib/i386
10:45:33,955 INFO [Log4jService] System property
[java.endorsed.dirs] = /usr/local/geronimo/server1/lib/endorsed:/
usr/jdk1.5.0_07/jre/lib/endorsed
10:45:33,955 INFO [Log4jService] System property
[java.ext.dirs] = /usr/local/geronimo/server1/lib/ext:/usr/
jdk1.5.0_07/jre/lib/ext
-
read: /usr/local/geronimo/bin/geronimo.sh
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
...
EXT_DIRS="$GERONIMO_BASE/lib/ext;$JRE_HOME/lib/ext"
ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed;$JRE_HOME/lib/endorsed"
else
EXT_DIRS="$GERONIMO_BASE/lib/ext:$JRE_HOME/lib/ext"
ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed:$JRE_HOME/lib/endorsed"
fi
-
There is no such directory as '/usr/local/geronimo/server1/lib/'
but the bin/geronimo.sh script uses GERONIMO_BASE to point at the
lib directory.
That should be $GERONIMO_HOME
GERONIMO_HOME is used only for the scope of the shell scripts, and
everything elses uses it for starting Geronimo, so we should be
consistent.
-
</error>
Index: assemblies/geronimo-boilerplate/src/main/underlay/bin/
client.bat
===================================================================
--- assemblies/geronimo-boilerplate/src/main/underlay/bin/client.bat
(revision 682467)
+++ assemblies/geronimo-boilerplate/src/main/underlay/bin/client.bat
(working copy)
@@ -150,7 +150,7 @@
:gotBase
if not "%GERONIMO_TMPDIR%" == "" goto gotTmpdir
-set GERONIMO_TMPDIR=var\temp
+set GERONIMO_TMPDIR="%GERONIMO_BASE%"\var\temp
:gotTmpdir
@REM ----- Execute The Requested Command
---------------------------------------
@@ -167,7 +167,7 @@
set CMD_LINE_ARGS=%*
set _JARFILE="%GERONIMO_HOME%"\bin\client.jar
-%_RUNJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -
Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib
\endorsed" -Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib
\ext" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -
Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %CMD_LINE_ARGS%
+%_RUNJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -
Djava.endorsed.dirs="%GERONIMO_HOME%\lib\endorsed;%JRE_HOME%\lib
\endorsed" -Djava.ext.dirs="%GERONIMO_HOME%\lib\ext;%JRE_HOME%\lib
\ext" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -
Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %CMD_LINE_ARGS%
goto end
:end
Index: assemblies/geronimo-boilerplate/src/main/underlay/bin/
geronimo.bat
===================================================================
--- assemblies/geronimo-boilerplate/src/main/underlay/bin/
geronimo.bat (revision 682467)
+++ assemblies/geronimo-boilerplate/src/main/underlay/bin/
geronimo.bat (working copy)
@@ -190,7 +190,7 @@
if not "%GERONIMO_TMPDIR%" == "" goto gotTmpdir
@REM A relative value will be resolved relative to each instance
-set GERONIMO_TMPDIR=var\temp
+set GERONIMO_TMPDIR="%GERONIMO_BASE%"\var\temp
:gotTmpdir
set _EXECJAVA=%_RUNJAVA%
@@ -311,17 +311,17 @@
:doneSetArgs
@REM Setup the Java programming language agent
-set JAVA_AGENT_JAR=%GERONIMO_BASE%\bin\jpa.jar
+set JAVA_AGENT_JAR=%GERONIMO_HOME%\bin\jpa.jar
set JAVA_AGENT_OPTS=
if exist "%JAVA_AGENT_JAR%" set JAVA_AGENT_OPTS=-
javaagent:"%JAVA_AGENT_JAR%"
@REM Execute Java with the applicable properties
if not "%JDB%" == "" goto doJDB
-%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -
Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib
\endorsed" -Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib
\ext" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -
Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %_LONG_OPT%
%CMD_LINE_ARGS%
+%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -
Djava.endorsed.dirs="%GERONIMO_HOME%\lib\endorsed;%JRE_HOME%\lib
\endorsed" -Djava.ext.dirs="%GERONIMO_HOME%\lib\ext;%JRE_HOME%\lib
\ext" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -
Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %_LONG_OPT%
%CMD_LINE_ARGS%
goto end
:doJDB
-%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -sourcepath "%JDB_SRCPATH%"
-Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib
\endorsed" -Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib
\ext" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -
Djava.io.tmpdir="%GERONIMO_TMPDIR%" -classpath %_JARFILE% %MAINCLASS
% %CMD_LINE_ARGS%
+%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -sourcepath "%JDB_SRCPATH%"
-Djava.endorsed.dirs="%GERONIMO_HOME%\lib\endorsed;%JRE_HOME%\lib
\endorsed" -Djava.ext.dirs="%GERONIMO_HOME%\lib\ext;%JRE_HOME%\lib
\ext" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -
Djava.io.tmpdir="%GERONIMO_TMPDIR%" -classpath %_JARFILE% %MAINCLASS
% %CMD_LINE_ARGS%
goto end
:end
Index: assemblies/geronimo-boilerplate/src/main/underlay/bin/client.sh
===================================================================
--- assemblies/geronimo-boilerplate/src/main/underlay/bin/client.sh
(revision 682467)
+++ assemblies/geronimo-boilerplate/src/main/underlay/bin/client.sh
(working copy)
@@ -167,7 +167,7 @@
if [ -z "$GERONIMO_TMPDIR" ] ; then
# Define the java.io.tmpdir to use for Geronimo
- GERONIMO_TMPDIR=var/temp
+ GERONIMO_TMPDIR="$GERONIMO_BASE"/var/temp
fi
# For Cygwin, switch paths to Windows format before running java
@@ -177,11 +177,11 @@
GERONIMO_HOME=`cygpath --absolute --windows "$GERONIMO_HOME"`
GERONIMO_BASE=`cygpath --absolute --windows "$GERONIMO_BASE"`
GERONIMO_TMPDIR=`cygpath --windows "$GERONIMO_TMPDIR"`
- EXT_DIRS="$GERONIMO_BASE/lib/ext;$JRE_HOME/lib/ext"
- ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed;$JRE_HOME/lib/endorsed"
+ EXT_DIRS="$GERONIMO_HOME/lib/ext;$JRE_HOME/lib/ext"
+ ENDORSED_DIRS="$GERONIMO_HOME/lib/endorsed;$JRE_HOME/lib/endorsed"
else
- EXT_DIRS="$GERONIMO_BASE/lib/ext:$JRE_HOME/lib/ext"
- ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed:$JRE_HOME/lib/endorsed"
+ EXT_DIRS="$GERONIMO_HOME/lib/ext:$JRE_HOME/lib/ext"
+ ENDORSED_DIRS="$GERONIMO_HOME/lib/endorsed:$JRE_HOME/lib/endorsed"
fi
# ----- Execute The Requested Command
-----------------------------------------
Index: assemblies/geronimo-boilerplate/src/main/underlay/bin/
geronimo.sh
===================================================================
--- assemblies/geronimo-boilerplate/src/main/underlay/bin/
geronimo.sh (revision 682467)
+++ assemblies/geronimo-boilerplate/src/main/underlay/bin/
geronimo.sh (working copy)
@@ -213,7 +213,7 @@
if [ -z "$GERONIMO_TMPDIR" ] ; then
# Define the java.io.tmpdir to use for Geronimo
# A relative value will be resolved relative to each instance
- GERONIMO_TMPDIR=var/temp
+ GERONIMO_TMPDIR="$GERONIMO_BASE"/var/temp
fi
if [ -z "$GERONIMO_OUT" ] ; then
@@ -235,11 +235,11 @@
GERONIMO_HOME=`cygpath --absolute --windows "$GERONIMO_HOME"`
GERONIMO_BASE=`cygpath --absolute --windows "$GERONIMO_BASE"`
GERONIMO_TMPDIR=`cygpath --windows "$GERONIMO_TMPDIR"`
- EXT_DIRS="$GERONIMO_BASE/lib/ext;$JRE_HOME/lib/ext"
- ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed;$JRE_HOME/lib/endorsed"
+ EXT_DIRS="$GERONIMO_HOME/lib/ext;$JRE_HOME/lib/ext"
+ ENDORSED_DIRS="$GERONIMO_HOME/lib/endorsed;$JRE_HOME/lib/endorsed"
else
- EXT_DIRS="$GERONIMO_BASE/lib/ext:$JRE_HOME/lib/ext"
- ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed:$JRE_HOME/lib/endorsed"
+ EXT_DIRS="$GERONIMO_HOME/lib/ext:$JRE_HOME/lib/ext"
+ ENDORSED_DIRS="$GERONIMO_HOME/lib/endorsed:$JRE_HOME/lib/endorsed"
fi
# ----- Execute The Requested Command
-----------------------------------------
@@ -284,7 +284,7 @@
fi
# Setup the Java programming language agent
-JAVA_AGENT_JAR="$GERONIMO_BASE/bin/jpa.jar"
+JAVA_AGENT_JAR="$GERONIMO_HOME/bin/jpa.jar"
if [ -f "$JAVA_AGENT_JAR" ]; then
JAVA_AGENT_OPTS="-javaagent:$JAVA_AGENT_JAR"
else