How to run Jboss 4.0.1 as a windows service.

(Last modified: 14Feb2006)

This document (10097484) is provided subject to the disclaimer at the end of this document.

goal

How to run Jboss 4.0.1 as a windows service.

fact

JBoss 4.0.1

fix

You can use a third party utility such as "JavaService.exe":
   Please check the web for available download sites

Example Install Command:
: JBossService.exe -install JBoss
{JDK_HOME}\jre\bin\{hotspot|server|classic}\jvm.dll
-Djava.class.path={JDK_HOME}\lib\tools.jar;{JBOSS_BIN}\run.jar
-start org.jboss.Main
-stop org.jboss.Main -method systemExit
-out {JBOSS_BIN}\stdout.log
-err {JBOSS_BIN}\stderr.log
-current {JBOSS_BIN}
-depends mysql
-manual

Please note that as at JavaService version 1.2.7 and back, no spaces may be used in the absolute paths given. A JVM located at C:\Program files\java\j2sdk1.5.0\jre\bin\server\jvm.dll will fail to instantiate because of the space in \Program files\.

You can also use a Java Service Wrapper and manage it by JMX:
sample configuration files :
wrapper.conf :
wrapper.java.command=%JAVA_HOME%/bin/java
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
wrapper.java.classpath.1=%JBOSS_HOME%/server/default/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%/server/default/lib
wrapper.app.parameter.1=org.jboss.Main
wrapper.logfile=%JBOSS_HOME%/server/default/log/wrapper.log
wrapper.ntservice.name=JBoss
wrapper.ntservice.displayname=JBoss Server

Warning: make sure your JBOSS_HOME environment var is set correctly (this is not the case if you haven't done that yourself): the run.bat does set this itself, but the wrapper doesn't !

note

To start a particular JBoss instance when starting JBoss as a service (besides the 'default' instance) you need to add the following after the -start in the JBossService line (the following starts the IDM instance which is the default name of the instance installed for the Novell Identity Manager User Application; substitute 'IDM' for the correct instance name if you have a different instance name):

-params -c IDM

This adds the following to the registry:

HKLM\SYSTEM\CurrentControlSet\Services\JBoss\Parameters
Start Param Count                   REG_DWORD      ox00000002
Start Param Number 0             REG_SZ               -c
Start Param Number 1             REG_SZ               IDM

Example service startup based on a test installation.  The application instance was named 'IDM' and the install path was c:\novell\idm.

javaService.exe - install JBoss c:\novell\idm\jre\bin\client\jvm.dll
-Djava.class.path=c:\novell\idm\jre\lib\tools.jar;c:\novell\idm\jboss\bin\run.jar
-Xms64M -Xmx128M
-start org.jboss.Main
-params -c IDM
-stop org.jboss.Main
-method systemExit
-out c:\novell\idm\jboss\bin\stdout.log
-err c:\novell\idm\jboss\bin\stderr.log
-current c:\novell\idm\jboss\bin
-depends mysql
-manual

document

Document Title: How to run Jboss 4.0.1 as a windows service.
Document ID: 10097484
Solution ID: NOVL101922
Creation Date: 26Apr2005
Modified Date: 14Feb2006
Novell Product Class:exteNd

disclaimer

The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information.
Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.