[jboss-user] Re: Running JBoss 4.0 as a Windows Service

samk at twinix.com samk at twinix.com
Wed Nov 7 22:40:13 EST 2007


See Thread at: http://www.techienuggets.com/Detail?tx=23 Posted on behalf of a User

This worked fine for me w/ JBoss 4.0.5.

I used the same setup for a 4.2.2 box, but w/ the added "security" feature, it only runs on the "localhost" address.  

Is there an easy way to change this to run on the NIC address, or both?  Comparable to doing "run.bat -b 0.0.0.0" or "run.bat -b 192.168.100.123"

Thanks!

In Response To: 

People have been complaining bitterly about JBoss 4.0.3SP1 crashing nightly with Java 1.5. We have looked
at that problem reported and we cannot figure out why the JVM is complaining. Repeated bug reports to
Sun, according to this person, have produced no results. Therefore we have taken a Windows desktop running
Windows 2000 and have installed JBoss as a server. Now I will admit that we are Unix/Linux bigots and
it was somewhat painful to work on a windows machine. Difficult to keep / \ apart not to mention the space
between program files. It is enough to drive you batty but we have presevered and have got JBoss to run
as a server. The beauty of this is that you can configure the Service to restart in a minute if it crashes
so even if Java 1.5 is buggy as all heck this should keep your application server afloat.

All the samples that we found showing how to run JBoss as a service are buggy. Use what we have done
here to have a smooth install.

1. Download JavaService-2.0.7.zip from http://forge.objectweb.org/project/showfiles.php?group_id=137

2. Extract to C:\JavaService-2.0.7

3. copy JavaService.exe to jboss bin directory. In our case C:\Program Files\jboss-4.0.2

4. Make sure JBOSS_HOME and JAVA_HOME are set. In our case: C:\Program Files\jboss-4.0.2 and C:\Program
Files\Java\jdk1.5.0_02 respectively

5. Create a batch file install.bat in %JBOSS_HOME%/bin directory. Its contents should be as follows:

Rem Start Here
set javadll=%JAVA_HOME%\jre\bin\client\jvm.dll
set javatool=%JAVA_HOME%\lib\tools.jar
set javarun=%JBOSS_HOME%\bin\run.jar
set outlog=%JBOSS_HOME%\bin\stdout.log
set errlog=%JBOSS_HOME%\bin\stderr.log

JBossService.exe -install JBoss "%javadll%" -Djava.class.path="%javatool%";"%javarun%" -start org.jboss.Main
-stop org.jboss.Main -method systemExit -out "%outlog%" -err "%errlog%" -current "%JBOSS_HOME%\bin" -manual


Rem End Here

Make sure to set word wrap off in the file and do not forget the quotes. This will allow the Program
Files path to work correctly. You can change the location of stderr.log and stdout.log to server/model/log
if you prefer.

Start a cmd window and cd to %JBOSS_HOME%\bin. run install.bat by typing install. This will install JBoss
as a service. 

To start the service type net start JBoss.

JBoss should now be running as a service. Enjoy.






More information about the jboss-user mailing list