Following our documentation to create a Windows Service, you may notice the service starts your JBoss instance as expected, but fails to shut down the instance. The service shows as "Stopping" and the only option is to kill the Java.exe process.

The following exception is returned in your log file:

Failed to connect to the controller

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)







... 8 more JBAS012174: Could not connect to remote://localhost:9999. The connection failed


The error indicates JBoss is unable to connect to the Management Interface when shutting down: JBAS012174: Could not connect to remote://localhost:9999. The connection failed

This interface is configured in the "Standalone.xml" (Standalone) or "Domain.xml" (Cluster):


    <interface name="management">           

        <inet-address value="${}"/>


    <interface name="public">

        <inet-address value="${}"/>


     <interface name="unsecure">

        <inet-address value="${jboss.bind.address.unsecure:}"/>   



In addition, the management-native socket is configured in the following section:

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

    <socket-binding name="management-native" interface="management" port="${}"/>

    <socket-binding name="management-http" interface="management" port="${}"/>

    <socket-binding name="management-https" interface="management" port="${}"/>

<socket-binding name="ajp" port="8009"/>



Should you use the pre-configured JBoss instance, the above sections need to be configured manually. The configuration steps are available from the following link.

An alternative is to re-install the service using the following commands:

service uninstall

service.bat install /startup /controller= /config standalonecustomized‐1.xml