...
As we are trying to keep all the wrapper files within Geronimo's directory structure, create the configuration file as illustrated in the following example and place it in the <geronimo_home>/var/conf/wrapper.conf directory.
No Format | ||||||
---|---|---|---|---|---|---|
| ||||||
# 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.base.dir="<geronimo_home>" wrapper.java.additional.5=-Djava.io.tmpdir="<geronimo_home>/var/temp" # Good old classpath, make sure to include /bin/server.jar and /bin/shutdown.jar wrapper.java.classpath.1=../lib/wrapper.jar wrapper.java.classpath.2=../bin/server.jar wrapper.java.classpath.3=../bin/shutdown.jar wrapper.java.classpath.4=../lib/geronimo-cli-2.0-SNAPSHOT.jar wrapper.java.classpath.5=../lib/geronimo-kernel-2.0-SNAPSHOT.jar wrapper.java.classpath.6=../lib/geronimo-transformer-2.0-SNAPSHOT.jar wrapper.java.classpath.7=../lib/commons-cli-1.0.jar wrapper.java.classpath.8=../lib/commons-logging-1.0.4.jar wrapper.java.classpath.9=../lib/cglib-nodep-2.1_3.jar wrapper.java.classpath.10=../lib/log4j-1.2.14.jar wrapper.java.classpath.11=../lib/xpp3-1.1.3.3.jar wrapper.java.classpath.12=../lib/xstream-1.1.3.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.0 Server wrapper.ntservice.name=Geronimo wrapper.ntservice.displayname=Apache Geronimo v2.0 Server wrapper.ntservice.description=Apache Geronimo v2.0 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 | ||||||
---|---|---|---|---|---|---|
| ||||||
@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 | ||||||
---|---|---|---|---|---|---|
| ||||||
@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 |
...
No Format bgColor #000000 borderStyle solid
D:\geronimo-tomcat6-jee5-2.0\bin>Install_Geronimo_NT.bat
wrapper | Apache Geronimo v2.0 Server installed.
No Format | ||||||
---|---|---|---|---|---|---|
| ||||||
@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 |
...