Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Create the configuration file as illustrated in the following example and place it in the <geronimo_home>/var/config/wrapper.conf directory to keep all the wrapper files within Geronimo's directory structure.

No Format
borderStylesolid
titlewrapper.confborderStylesolid
# Location of java.exe (in Windows)

wrapper.java.command=<java_home>/bin/java

# These additional parameters are required to start the server since we are not setting any
# environment variables prior to running the wrapper.

wrapper.java.additional.1=-javaagent:"<geronimo_home>/bin/jpa.jar"
wrapper.java.additional.2=-Djava.ext.dirs="<geronimo_home>/lib/ext;<java_home>/jre/lib/ext"
wrapper.java.additional.3=-Djava.endorsed.dirs="<geronimo_home>/lib/endorsed;<java_home>/jre/lib/endorsed"
wrapper.java.additional.4=-Dorg.apache.geronimo.home.dir="<geronimo_home>"
wrapper.java.additional.5=-Djava.io.tmpdir="<geronimo_home>/var/temp"

# Classpath

wrapper.java.classpath.1=../lib/wrapper.jar
wrapper.java.classpath.2=../bin/server.jar


# Location of the wrapper.dll (in Windows)

wrapper.java.library.path.1=../lib

# Main class the wrapper will use.

wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

# Geronimo start class and parameters.

wrapper.app.parameter.1=org.apache.geronimo.cli.daemon.DaemonCLI

# Log settings.

wrapper.console.format=PM
wrapper.console.loglevel=INFO
wrapper.logfile=../var/log/wrapper.log
wrapper.logfile.format=LPTM
wrapper.logfile.loglevel=INFO
wrapper.logfile.maxsize=0
wrapper.logfile.maxfiles=0
wrapper.syslog.loglevel=INFO

# Windows service name and description.

wrapper.console.title=Apache Geronimo v2.2 Server
wrapper.ntservice.name=Geronimo
wrapper.ntservice.displayname=Apache Geronimo v2.2 Server
wrapper.ntservice.description=Apache Geronimo v2.2 Server
wrapper.ntservice.dependency.1=
wrapper.ntservice.starttype=AUTO_START
wrapper.ntservice.interactive=false

...

Next we will create a batch file to run the service from the command line without the need of actually installing the service. This is particularly helpful when testing and debugging the configuration. Create the g_service.bat batch file in the <geronimo_home>/bin directory and copy the content of the following example.

No Format
borderStylesolid
titleg_service.batborderStylesolid
@echo off
setlocal

rem Copyright (c) 1999, 2006 Tanuki Software Inc.
rem
rem Java Service Wrapper general startup script
rem

rem
rem Resolve the real path of the wrapper.exe
rem  For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem  can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof

:nt
rem
rem Find the application home.
rem
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0

rem Decide on the wrapper binary.
set _WRAPPER_BASE=wrapper
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
if exist "%_WRAPPER_EXE%" goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
echo %_REALPATH%%_WRAPPER_BASE%.exe
pause
goto :eof

rem
rem Find the wrapper.conf
rem
:conf
set _WRAPPER_CONF="%~f1"
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_REALPATH%..\var\config\wrapper.conf"

rem
rem Start the Wrapper
rem
:startup
"%_WRAPPER_EXE%" -c %_WRAPPER_CONF%
if not errorlevel 1 goto :eof
pause

...

The following two batch files are provided to install and remove Geronimo as a Windows service. Create the files in the <geronimo_home>/bin directory and copy the content as depicted in the following examples.

No Format
borderStylesolid
titleInstall_Geronimo_NT.batborderStylesolid
@echo off
setlocal

rem Copyright (c) 1999, 2006 Tanuki Software Inc.
rem
rem Java Service Wrapper general NT service install script
rem

if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof

:nt
rem
rem Find the application home.
rem
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0

rem Decide on the wrapper binary.
set _WRAPPER_BASE=wrapper
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
if exist "%_WRAPPER_EXE%" goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
echo %_REALPATH%%_WRAPPER_BASE%.exe
pause
goto :eof

rem
rem Find the wrapper.conf
rem
:conf
set _WRAPPER_CONF="%~f1"
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_REALPATH%..\var\config\wrapper.conf"

rem
rem Install the Wrapper as an NT service.
rem
:startup
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
if not errorlevel 1 goto :eof
pause

...

You should get a confirmation screen similar to this example.

No Format
borderStylesolid
D:\geronimo-tomcat6-javaee5-2.2\bin>Install_Geronimo_NT.bat
wrapper  | Apache Geronimo v2.2 Server installed.

No Format
borderStylesolid
titleUninstall_Geronimo_NT.batborderStylesolid
@echo off
setlocal

rem Copyright (c) 1999, 2006 Tanuki Software Inc.
rem
rem Java Service Wrapper general NT service uninstall script
rem

if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof

:nt
rem
rem Find the application home.
rem
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0

rem Decide on the wrapper binary.
set _WRAPPER_BASE=wrapper
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
if exist "%_WRAPPER_EXE%" goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
echo %_REALPATH%%_WRAPPER_BASE%.exe
pause
goto :eof

rem
rem Find the wrapper.conf
rem
:conf
set _WRAPPER_CONF="%~f1"
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_REALPATH%..\var\config\wrapper.conf"

rem
rem Uninstall the Wrapper as an NT service.
rem
:startup
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
if not errorlevel 1 goto :eof
pause

...