Stopping Wildfly Windows Service failed

user99316 picture user99316 · Jul 15, 2016 · Viewed 9.2k times · Source

as mentioned from the title i have a problem stopping the wildfly windows service. When i tried to stop the wildfly service via the server manager - services window the status of the wildfly service doens't change to stop from stop pending. But wildfly isn't running anymore (my web service is not reachable and also the server log says that wildfly was successfully stopped). to start the service again i have to restart the windows server.

i've tested this with different scenarios:

  • Windows Server 2008 R2 Datacenter + Wildfly 9
  • Windwos Server 2012 Datacenter + Wildfly 10
  • Windows 7 + Wildfly 10

I also tried to make changes in the service.bat like Chris French mentioned on https://developer.jboss.org/thread/238135?tstart=0 but there is no change.

Interessting is that the problem doens't exists on any of the scenarios when i added the service without adding any deployments to wildfly (so just the blank server). What means that i am able to start and stop the wildfly service successfully from the server manager services window when the wildfly server is "blank" and without any changes (for e.g. in standalone.xml).

So i think the problem must be my java ee project which contains a web service and a simple persistent project to access different my sql databases. In the standalone.xml i just added the mysql driver and the databases and i do some edits in the interface section (ip adress changes).

Any Ideas? Do i have to made changes in different config files (for e.g. the service.bat) when im deploying something to wildfly?

Sorry for my english and thanks a lot!

Answer

Igromanru picture Igromanru · Aug 30, 2016

That works for me:
1. Always run the CMD as admin first.
2. If your JBOSS_HOME environment is not set, get sure that you navigate to WildFly home directory before you execute the script.
For example: cd "C:\Program Files\wildfly
It's matter, because the service.bat takes your current dir (%CD%) as JBOSS_HOME, if it's not set.
3. You’ve to install the service with a special parameter. /controller
It’s important that you tell wildfly service on which port your wildfly admin console is running.
Take a look in standalone.xml, search for “management-http”, get sure that you use the same port in parameter.
Example: (Default port is 9990)

./bin/service/service.bat install /controller localhost:9990 

Done. Now start the service and wait until you can reach the wildfly console page.
After try to stop or restart the service in service.msc or with service.bat (service.bat start/stop/restart).