This is a simple Windows Service built in C# that manages the JBoss 7 Standalone Server in terms of starting and shutting down the server.
-
Define an environment variable called
JBOSS_HOME
that holds the absolute path where JBoss is installed (click here for see how to setup). This variable it's used by the service for resolve the path of the batch filesstandalone.bat
andjboss-cli.bat
. -
Ensure you have the command line utility
Installutil
which comes with .NET framework.
You can find it in this path:
%windir%\Microsoft.NET\Framework[64]\<dotnet_framework_version>
Where windir
is a system environment variable that points to the Windows OS files, and dotnet_framework_version
is the .NET framework version installed in your machine.
Clone this repository, and build it in your machine. Open a command prompt as Administrator, navigate to the JBoss
project compilation output folder: \Jboss\bin\{Debug | Release}
(you can enter either Debug
or Release
based on your build configuration), and run the command below to install the service in your machine:
> installutil JBoss.exe
By the way, I don't recommend register the service from the assembly located in your bin
folder. Instead, copy the assembly and store it in a new folder where you can isolate your service development.
In case you want to uninstall, ensure the service is not running, and run the command below:
> installutil /u JBoss.exe
Once you have installed the service, you're able to start using right away! 😃 Check below what happen when you start or stop the service:
- When the service is starting, it's invoking the
standalone.bat
batch file for startJBoss
in the background. - When the service is being stoped, it's calling the
jboss-cli.bat
batch file with the arguments--connect command=:shutdown
that sends a signal to the instance running ofJBoss
to shutdown.
If you face any problem when either starting or stoping the service, please refer to the Windows logs for more details.
If you encounter any issue while using it, don't doubt in creating an issue over here. I'd appreciate deliver its solution the soon as possible! (and also get help from the community 😁).
- In case the
jboss-cli.bat
file isn't found, theJBoss
can't be stopped even though the main process is killed (the process that started theJBoss
when the service itself began).