JBoss as a Windows Service

*Download Java Service Wrapper from here

*Set env variables

JAVA_HOME=
JBOSS_HOME=

*Copy the following files into the JBoss bin directory:

{WRAPPER_HOME}\bin\Wrapper.exe
{WRAPPER_HOME}\src\bin\App.bat.in
{WRAPPER_HOME}\src\bin\InstallApp-NT.bat.in
{WRAPPER_HOME}\src\bin\UninstallApp-NT.bat.in

*Rename the three batch files as follows.
Be sure to remove the .in extensions so that the files all end in .bat.
Depending on how your file explorer is configured,
you may not be able to see the extensions.

{JBOSS_HOME}\bin\JBoss.bat
{JBOSS_HOME}\bin\InstallJBoss-NT.bat
{JBOSS_HOME}\bin\UninstallJBoss-NT.bat

*Copy the following two files into the JBoss lib directory:

{WRAPPER_HOME}\server\default\lib\Wrapper.DLL
{WRAPPER_HOME}\server\default\lib\wrapper.jar

*Copy

{WRAPPER_HOME}\src\conf\wrapper.conf.in

to

{JBOSS_HOME}\server\default\conf\wrapper.conf

*Modify InstallJBoss-NT.bat and UninstallJBoss-NT.bat to reflect the wrapper.conf location (default wrapper.conf location is ../conf/wrapper.conf)

set _WRAPPER_CONF="%JBOSS_HOME%\server\default\conf\wrapper.conf"

*Edit 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=%JBOSS_HOME%/bin/run.jar
wrapper.java.library.path.1=%JBOSS_HOME%/server/default/lib
wrapper.java.additional.1=-server
wrapper.java.additional.2=-XX:PermSize=64M
wrapper.java.additional.3=-XX:MaxPermSize=256M
wrapper.java.initmemory=256
wrapper.java.maxmemory=512
wrapper.app.parameter.1=org.jboss.Main
wrapper.console.format=PM
wrapper.console.loglevel=INFO
wrapper.logfile=%JBOSS_HOME%/server/default/log/wrapper.log
wrapper.logfile.format=LPTM
wrapper.logfile.loglevel=INFO
wrapper.logfile.maxsize=0
wrapper.logfile.maxfiles=0
wrapper.syslog.loglevel=NONE
wrapper.console.title=JBoss Server
wrapper.ntservice.name=JBoss
wrapper.ntservice.displayname=JBoss Server
wrapper.ntservice.description=JBoss Server
wrapper.ntservice.dependency.1=
wrapper.ntservice.starttype=AUTO_START
wrapper.ntservice.interactive=false

*Install JBoss service
{JBOSS_HOME}\bin\InstallJBoss-NT.bat

*Uninstall JBoss service
{JBOSS_HOME}\bin\UninstallJBoss-NT.bat

This entry was posted in jboss. Bookmark the permalink.