The same directory structure used in the previous example will
be reused.
This time the wrapper.working.dir
property will be set the parent of the
bin directory in which
the Wrapper.exe file is
located. This is a location that is commonly referred to as the
application HOME. C:\myapp
in this case.
The wrapper.working.dir
property can be specified either on the command line
used to launch the Wrapper, or within the wrapper.conf file.
In either case, the specified directory can be absolute or
relative. In the case of a relative directory, the directory
will be relative to the location of the Wrapper binary.
This example will specify the new working directory within
the wrapper.conf file.
So in this case, the command used to launch the Wrapper is
unchanged, meaning that the batch files and scripts that
ship with the Wrapper can be used without any modification.
Wrapper.exe -c ../conf/wrapper.conf
|
When the Wrapper is launched, it immediately sets its working
directory to the location of the Wrapper binary. Then loads
the wrapper.conf file and
any include files using that working directory. Once the
configuration is loaded, the working directory will be changed
to the new location specified by the
wrapper.working.dir property.
All future paths including the launching of the JVM will be
done using this new working directory.
For this example the wrapper.conf
fragment used above will be modified as follows:
wrapper.working.dir=../
#include ../conf/include.conf
wrapper.java.classpath.1=lib/wrapper.jar
wrapper.java.classpath.2=lib/myapp.jar
wrapper.java.library.path.1=lib
wrapper.pidfile=bin/wrapper.pid
wrapper.java.pidfile=bin/java.pid
wrapper.logfile=logs/wrapper.log
|
Notice that the location of the include file and
wrapper.working.dir property
are both relative to the Wrapper binary location, but all other
paths are now relative to the new working directory.
The location of the wrapper.working.dir
property in the wrapper.conf file
is not important as it is not applied until after the entire
configuration file has been parsed.
As with any problems configuring the Wrapper. The first thing that
should be done when problems are encountered is to enable the
wrapper.debug property and
rerun the application. Make sure that the application can be run
as a console application before attempting to run it as a service
or daemon process.
|