I've recently had to wade through the setup of JBoss as a Windows service, and thought it would be useful if we (that is, you and me) post up the javaservice script files for other newbie?s to try, learn and understand.
To get things kicked off, if you intend to run ANY java application as a service, I woul recommend using
javaservice (I did try the java service wrapper, but eventually gave up):
Information: http://www.multiplan.co.uk/software/javaservice/index.html
Download: http://forge.objectweb.org/project/showfiles.php?group_id=137
Installation: http://www.multiplan.co.uk/software/javaservice/docs/index.html
To determine which jvm DLL to use, see the following post:
http://forum.java.sun.com/thread.jspa?forumID=33&threadID=527159.
And now, here's the installation script I used (note that I rename the javaservice executable to JBossService.exe):
JBossService.exe -install JBoss
%JAVA_HOME%\jre\bin\server\jvm.dll
-Dprogram.name=run.bat
-Xms128m
-Xmx512m
-Djava.endorsed.dirs=%JBOSS_HOME%\lib\endorsed
-Djava.class.path="%JAVA_HOME%\lib\tools.jar;%JBOSS_HOME%\bin\run.jar"
-start org.jboss.Main
-stop org.jboss.Main
-method systemExit
-out %JBOSS_HOME%\log\stdout.log
-err %JBOSS_HOME%\log\stderr.log
-make sure that the %JBOSS_HOME%\log directory exists.
The script above should work on any machine with JBoss installed, as long as you have JBOSS_HOME and JAVA_HOME setup correctly.