Sunday, December 2, 2007

Installating JBoss with the Tanuki wrapper

We use Windows 2003 servers in our architecture so we make extensive use of the Tanuki wrapper. However, with all the options involved and with the all the quirk in running JBoss, it is always a challenge to configure the wrapper correctly.

Here are the steps we took to get JBoss running as a service in our Windows 2003 server:

  1. Create environment variable JBOSS_HOME and point this to the installation directory of JBoss
  2. Copy wrapper.exe from {wrapper_installer}\bin to {JBoss}\bin directory
  3. Copy wrapper.dll and wrapper.jar fro {wrapper_installer}\lib to {JBoss}\lib
  4. Copy App.bat.in, InstallApp-NT.bat.in and UninstallApp-NT.bat.in from {wrapper_installer}\src\bin to {JBOSS}\bin directory and remove the .in extensions
  5. Create directory {JBoss}\conf and copy wrapper.conf.in from {wrapper_installer}\src\conf to {JBoss}\conf; remove the .in extension.
  6. Make the wrapper.conf file look like this:

wrapper.java.command=%JAVA_HOME%/bin/java

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

wrapper.java.classpath.1=%JBOSS_HOME%/lib/wrapper.jar

wrapper.java.classpath.2=%JAVA_HOME%/lib/tools.jar

wrapper.java.classpath.3=./run.jar

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

wrapper.java.additional.1=-server

#parameters to start Jboss

wrapper.app.parameter.1=org.jboss.Main

#parameter to start default server

wrapper.app.parameter.2=-c default

# Initial Java Heap Size (in MB)

wrapper.java.initmemory=256

# Maximum Java Heap Size (in MB)

wrapper.java.maxmemory=1024

wrapper.logfile=%JBOSS_HOME%/logs/wrapper.log

# name of service as in net startstop JBoss

wrapper.ntservice.name=JBoss

# Name of server as it is displayed

wrapper.ntservice.displayname=JBoss Server

# Description of the service

wrapper.ntservice.description=JBoss 4.0.3 Server

# Mode in which the service is installed. AUTO_START or DEMAND_START

wrapper.ntservice.starttype=DEMAND_START

# Priority at which the service is run. NORMAL, LOW, HIGH, or REALTIME

wrapper.ntservice.process_priority=HIGH

# Allow the service to interact with the desktop.

wrapper.ntservice.interactive=false

Default the wrapper starts the default server in Jboss; we need to the the all server, because we are depending on the extra services from the all server. The wrapper.app.parameter.2 and ..3 accomplish this. This is equivalent to starting jboss with run –c all

  1. Install and start the server using wrapper.exe -i ../conf/wrapper.conf and wrapper.exe -t../conf/wrapper.conf

No comments: