Running as a Service in Windows

Written by Joseph Ottinger

Running orion as a windows service can be achieved easily with the Java Service Wrapper

The documentation provided by the service wrapper is excellent, however, here is an example configuration file to help get you started:

wrapper.java.command=<jdkhome>/bin/java
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

wrapper.java.classpath.1=orion.jar
wrapper.java.classpath.2=jdbc.jar
wrapper.java.classpath.3=activation.jar
wrapper.java.classpath.4=mail.jar
wrapper.java.classpath.5=jsse.jar
wrapper.java.classpath.6=jnet.jar
wrapper.java.classpath.7=jdbc.jar
wrapper.java.classpath.8=ejb.jar
wrapper.java.classpath.9=jaxp.jar
wrapper.java.classpath.10=crimson.jar
wrapper.java.classpath.11=xalan.jar
wrapper.java.classpath.12=jta.jar
wrapper.java.classpath.13=parser.jar
wrapper.java.classpath.14=jaas.jar
wrapper.java.classpath.15=jcert.jar
wrapper.java.classpath.16=<jdkhome>/lib/tools.jar
wrapper.java.classpath.17=wrapper.jar

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

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

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

# Application parameters.  Add parameters as needed starting from 1
wrapper.app.parameter.1=com.evermind.server.ApplicationServer
wrapper.app.parameter.2=-out
wrapper.app.parameter.3=log/console.log
wrapper.app.parameter.4=-err
wrapper.app.parameter.5=log/err-console.log

# Port which the native wrapper code will attempt to connect to
wrapper.port=1777

#********************************************************************
# Wrapper Logging parameters
#********************************************************************
# 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=ERROR

# Log file to use for wrapper output logging.
wrapper.logfile=log/ntservice.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=STATUS

# 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=5

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

#********************************************************************
# Wrapper NT Service parameters
#********************************************************************
# WARNING - Do not modify any of these parameters 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=orion

# Display name of the service
wrapper.ntservice.displayname=Orion Application Server

# Description of the service
wrapper.ntservice.description=Controls the Orion Application Server

wrapper.request_thread_dump_on_failed_jvm_exit=TRUE

# 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=AUTO_START

# Priority at which the service is run.  NORMAL, LOW, HIGH, or
#  REALTIME
wrapper.ntservice.process_priority=NORMAL 

Copyright © 2007 IronFlare AB