One, added as a Windows service
Go to directory \wildfly-9.0.2s-all\bin\service\ edit Service.bat, modify the parameters
Set Shortname=samexappserver--service name
Set Displayname= "Samexappserver"
Set description= "Samex Wildfly application Server"
SET java_home=d:\java\jdk1.7.0_51
Right-click Wildfly-service.exe to execute and then enter service to see Samexappserver.
Second, timed restart
Because SQL Server database consumes more memory, you need to reboot the database as well as restart JBoss.
To write the restart bat script:
@echo off
echo Stop Samex
net stop Samexappserver
echo Stop Databaseagent
net stop SQLServerAgent
echo Stop Database
net stop MSSQLSERVER
Ping-n 3 127.0.0.1>nul
echo Start Database
net start MSSQLSERVER
echo Start databaseagent
Net start SQLServerAgent
echo Start Samex
net start Samexappserver
Then, go to the Control Panel-management tool-Task Scheduler, which defines a task that executes 1 o'clock in the morning every day.
JBoss adds a Windows service while periodically restarting