Wednesday 11 June 2014

Run Jboss Application server as Windows Service

Hi all,
 
Here is the scenario where I want to run my jboss application server as windows services.  This configuration allows JBoss Server to start automatically, as a background process, whenever the Windows Server boots. The process does not require a logged-in user to initiate it, and so will not be killed if that user logs off. It will also restart automatically if the Windows Server reboots.

 

Procedure:


Ensure you have administrator access to the Windows server on which JBoss is installed.
First of all you can get the latest appropriate native connectors depending on your system configurations, till now the latest JBoss native components is 2.0.10 which can be download from the RedHat site. Once you have downloaded it unzip the archive in the JBoss bin folder.




The bin folder contain following files 


Now the below changes has to be done in the service.bat file.

Set JAVA_HOME if you don’t want to set it in Windows environment variable, or in case you have more than one jboss instances running.

set JBOSS_HOME=E:\App_Server\jboss-as-7.1.1.Final

Change the following parameter for service name and description.

set SVCNAME=JBASS_Service
set SVCDISP=JBoss_Service
set SVCDESC=JBoss Application Server 7.1.1 Platform: Windows x64

Set a path of your JBOSS_HOME instated of default paths after following parameter

jbosssvc.exe -p 1 "Starting %SVCDISP%" >
call standalone.bat  --server-config=standalone.xml < .r.lock >>  
jbosssvc.exe -p 1 "Shutdown %SVCDISP% service" >>
call jboss-cli.bat --connect command=:shutdown >>

Once all these changes have been made now its time to install the JBoss AS 7 service using the service.bat script and below command

JBOSS_HOME/bin >service.bat install
Installed JBASS_Service
Service JBASS_Service installed

After the above command is been run successfully you can go to the Windows Service console and change the respective service  Startup Type from Manual to Automatic which would make sure that whenever you start/bootup your system the JBoss AS 7 services starts up automatically

You can use the below given command to stop the Windows service once it has been started or else you can even do the same from the Windows Service console

JBOSS_HOME/bin >service.bat stop

It works in my case hope this will help you.

Effort only fully releases its reward after a person refuses to quit.”

Regards,
Akhilesh B. Humbe

No comments:

Post a Comment

Popular Posts