IBM Support

How to configure WebSphere Application Server Community Edition V1.1 as a Microsoft Windows Service

Education


Abstract

This document explains the steps to configure WebSphere® Application Server Community Edition V1.1 as a Microsoft Windows® Service

Content

Configuring WebSphere Application Server Community Edition as a service V1.1 is achieved by using Java Service Wrapper (JSW).

JSW makes it possible to install a Java Application as a Windows Service. JSW gives additional control over the service such as the ability to ping the service and take appropriate action when the service is down.

JSW is available for download here http://sourceforge.net/projects/wrapper/

Configuration Steps

1. Installing Java Service Wrapper

Download JSW and extract the contents to a directory. Throughout the document this directory is referred to as <jsw_home>

2. Configuring the wrapper

JSW comes with a sample configuration file named wrapper.conf

wrapper.conf is located in the <jsw_home>\conf directory. Save a copy of the original wrapper.conf and create a new one. The new one should contain the following content

#********************************************************************
# Wrapper Properties
#********************************************************************
# Java Application
wrapper.java.command=<java_home>\jre\bin\java

# Java Main class. This class must implement the WrapperListener interface
# or guarantee that the WrapperManager class is initialized. Helper
# classes are provided to do this for you. See the Integration section
# of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperStartStopApp


# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=<jsw_home>\lib\wrapper.jar
wrapper.java.classpath.2=<wasce_home>\lib\cglib-nodep-2.1_3.jar
wrapper.java.classpath.3=<wasce_home>\lib\commons-cli-1.0.jar
wrapper.java.classpath.4=<wasce_home>\lib\commons-logging-1.0.4.jar
wrapper.java.classpath.5=<wasce_home>\lib\geronimo-common-1.1.1.jar
wrapper.java.classpath.6=<wasce_home>\lib\geronimo-deploy-jsr88-1.1.1.jar
wrapper.java.classpath.7=<wasce_home>\lib\geronimo-deploy-tool-1.1.1.jar
wrapper.java.classpath.8=<wasce_home>\lib\geronimo-deployment-1.1.1.jar
wrapper.java.classpath.9=<wasce_home>\lib\geronimo-j2ee-deployment_1.1_spec-1.0.1.jar
wrapper.java.classpath.10=<wasce_home>\lib\geronimo-kernel-1.1.1.jar
wrapper.java.classpath.11=<wasce_home>\lib\geronimo-qname_1.1_spec-1.0.1.jar
wrapper.java.classpath.12=<wasce_home>\lib\geronimo-system-1.1.1.jar
wrapper.java.classpath.13=<wasce_home>\lib\geronimo-util-1.1.1.jar
wrapper.java.classpath.14=<wasce_home>\lib\log4j-1.2.11.jar
wrapper.java.classpath.15=<wasce_home>\lib\mx4j-3.0.1.jar
wrapper.java.classpath.16=<wasce_home>\lib\mx4j-remote-3.0.1.jar
wrapper.java.classpath.17=<wasce_home>\bin\server.jar
wrapper.java.classpath.18=<wasce_home>\bin\shutdown.jar


# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=<jsw_home>\lib


# Java Additional Parameters
wrapper.java.additional.1=-Dorg.apache.geronimo.base.dir=<wasce_home>
wrapper.java.additional.2=-Djava.io.tmpdir=<wasce_home>\var\temp
wrapper.java.additional.3=-Djava.endorsed.dirs="<wasce_home>\lib\endorsed;<java_home>\jre\lib\endorsed"
wrapper.java.additional.4=-Djava.extension.dirs="<wasce_home>\lib\ext;<java_home>\jre\lib\ext"

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=32

# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=256

# Application parameters. Add parameters as needed starting from 1
#wrapper.app.parameter.1=
# Application parameters. Add parameters as needed starting from 1
# The first application parameter is the name of the class whose main
# method is to be called when the application is launched. The class
# name is followed by the number of parameters to be passed to its main
# method. Then comes the actual parameters.
wrapper.app.parameter.1=org.apache.geronimo.system.main.Daemon
wrapper.app.parameter.2=1
wrapper.app.parameter.3=--long
# The start parameters are followed by the name of the class whose main
# method is to be called to stop the application. The stop class name
# is followed by a flag which controls whether or not the Wrapper should
# wait for all non daemon threads to complete before exiting the JVM. Use
# wrapper.shutdown.timeout=30 to change the default of 30 secs.
# The flag is followed by the number of parameters to be passed to the
# stop class's main method. Finally comes the actual parameters.
wrapper.app.parameter.4=org.apache.geronimo.deployment.cli.StopServer
wrapper.app.parameter.5=true
wrapper.app.parameter.6=4
wrapper.app.parameter.7=--user
wrapper.app.parameter.8=system
wrapper.app.parameter.9=--password
wrapper.app.parameter.10=manager

# Filter settings, if you want to have special behaviour for logged messages
# uncomment the following lines
wrapper.filter.trigger.1=java.lang.OutOfMemoryError
wrapper.filter.action.1=RESTART
#wrapper.filter.trigger.1=JSWRestartGeronimo
#wrapper.filter.action.1=RESTART

#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console. (See docs for formats)
wrapper.console.format=PM

# Log Level for console output. (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=<wasce_home>\var\log\wrapperlogs.log

# Format of output for the log file. (See docs for formats)
wrapper.logfile.format=LPTM

# Log Level for log file output. (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
# the log is rolled. Size is specified in bytes. The default value
# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
# 'm' (mb) suffix. For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=1m

# Maximum number of rolled log files which will be allowed before old
# files are deleted. The default value of 0 implies no limit.
wrapper.logfile.maxfiles=0

# Log Level for sys/event log output. (See docs for log levels)
#wrapper.syslog.loglevel=NONE
wrapper.syslog.loglevel=STATUS

#********************************************************************
# Wrapper Windows Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=WebSphere Application Server Community Edition

# Flush stdout after each line of output is sent to the console.
wrapper.console.flush=true

#********************************************************************
# Wrapper Windows NT/2000/XP Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
# using this configuration file has been installed as a service.
# Please uninstall the service before modifying this section. The
# service can then be reinstalled.

# Name of the service
wrapper.ntservice.name=wasce

# Display name of the service
wrapper.ntservice.displayname=WebSphere Application Server Community Edition

# Description of the service
wrapper.ntservice.description=WebSphere Application Server Community Edition

# Service dependencies. Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=

# Mode in which the service is installed. AUTO_START or DEMAND_START
wrapper.ntservice.starttype=DEMAND_START

# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false

# The account to use when running the service. Use an account name in the
# form: {DomainName}\{UserName}. If the account belongs to the built-in
# domain, then you may specify the name if the form: .\{UserName}.
# The default, blank value, will use the LocalSystem account.
#wrapper.ntservice.account=

# The password of the account specified in wrapper.ntservice.account.
# If the account does not have a password, or if the LocalSystem account
# is being used, then this value can be blank. The default is no password.
#wrapper.ntservice.password=

Note : Replace <java_home>, <wasce_home> and <jsw_home> to corresponding paths where
Java ™ Runtime, WebSphere Application Server Community Edition and JSW are located. Other properties can be set as per your preference.

3. Installing the service

There are two scripts provided with JSW to install and uninstall the service

To add WebSphere Application Server Community Edition as a Microsoft Windows service run the following command:

<jsw_home>\bin\InstallTestWrapper-NT.bat

Verify successful installation in the wrapper.log file located at <wasce_home>\var\log\wrapperlog.log

STATUS | wrapper | 2007/07/03 18:51:18 | WebSphere Application Server Community Edition installed.

4. Uninstalling the service

To remove the WebSphere Application Server Community Edition service run the following command:

<jsw_home>\bin\UninstallTestWrapper-NT.bat

5. Running the WebSphere Application Server Community Edition Service

To run the service use the Microsoft Windows GUI interface or just use the command line option. For this working example the option of choice is the command line

From a Windows command line run the command:

net start wasce

On successful startup the following messages are displayed on the command window

C:\>net start wasce
The WebSphere Application Server Community Edition service is starting...
The WebSphere Application Server Community Edition service was started successfully.

Note
: WebSphere Application Server Community Edition may take a few moments to start even the message received that the service has successfully started as the server components could still be loading

Verify the <wasce_home>\var\log\wrapperlog.log to see if server is fully started, the last line in log file should be similar to this:

INFO | jvm 1 | 2007/07/04 13:18:58 | Server started

WebSphere Application Server Community Edition server has successfully started


6. Stopping the WebSphere Application Server Community Edition service

From a Windows command line run the command:

net stop wasce

On successful shutdown the following messages are displayed on the command window

C:\>net stop wasce
The WebSphere Application Server Community Edition service is stopping....
The WebSphere Application Server Community Edition service was stopped successfully.

Related Information

[{"Product":{"code":"SS6JMN","label":"WebSphere Application Server Community Edition"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"General","Platform":[{"code":"PF033","label":"Windows"}],"Version":"1.1.0.2;1.1.0.1;1.1","Edition":"Entry;Enhanced;Elite","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
17 June 2018

UID

swg27010092