Keep WildFly Windows Service running 24/7 with Service Protector

How to Keep the WildFly Windows Service Running 24/7 with Service Protector

Automatically restart WildFly when it crashes or gets stuck stopping. Ensure that your Java applications are always available!

WildFly provides a powerful, flexible runtime environment for your Java applications. This tutorial assumes that you have deployed WildFly as a Windows Service, to ensure that it starts as soon as your server boots:

To monitor and protect the WildFly Windows Service with Service Protector:

  1. Download and install Service Protector, if necessary.

  2. Start Service Protector.

  3. Select Protector > Add to open the Add Protector window:

    Add Protector

  4. On the General tab, in the Service to protect field, choose the WildFly windows service. There will be a green circle on the left if WildFly is already running, as was the case on our server:

  5. WildFly Windows Service: General Tab

  6. There are a few reports of WildFly occasionally getting stuck in the "Stopping" state. To have Service Protector automatically restart WildFly when that happens, click over to the Extras tab and check the corresponding option. We suggest leaving the timeout at the default of 60 seconds, but you can reduce that value if your situation warrants a more aggressive stance. (Checking is cheap.)

    WildFly Windows Service: Extras Tab

  7. Click the Save >> button. In a couple of seconds, an entry for WildFly will show up in the Service Protector window. The WildFly service is probably already running but it is not yet being protected by Service Protector, hence the red shield on the "Protection" column:

    WildFly Windows Service: Created

  8. To start protection, choose Protector > Start "Wildfly". After a couple of seconds, the shield icon will go to green to indicate that WildFly is being monitored by Service Protector:

    WildFly Windows Service: Running

    Note that clicking on the green "Running" circle will show a few details of the service...

    WildFly Windows Service: Service Details

    ... and clicking the green shield will show how protection is doing:

    WildFly Windows Service: Protection Details

  9. That's it! Next time your computer boots, WildFly will start and Service Protector will begin monitoring the service to promptly restart it if it fails or stops for any reason.

    We encourage you to edit WildFly in Service Protector and check out the many other settings that may be appropriate for your environment. For example, send an email when the service fails, restart WildFly nightly to cure memory leaks, and much more.

Trouble protecting the WildFly Windows Service?