Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I shutdown JBoss Wildfly when I can't access the CLI tool?

I"m using Wildfly 10.0.0.CR2 with Java 8. I have Wildfly listening for http connections on port 8080 and in the past have used this command to shut down the server ...

./jboss-cli.sh --connect command=:shutdown

HOwever, occassionally, I'm not able to access this tool, even though the server is still running. Note the interaction below on my Mac ...

Daves-MacBook-Pro-2:bin davea$ ./jboss-cli.sh --connect command=:shutdown
Failed to connect to the controller: The controller is not available at localhost:9990: java.net.ConnectException: WFLYPRT0023: Could not connect to http-remoting://localhost:9990. The connection timed out: WFLYPRT0023: Could not connect to http-remoting://localhost:9990. The connection timed out
Daves-MacBook-Pro-2:bin davea$ telnet localhost 8080
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

My question is, what is a foolproof way to shutdown the JBoss server? Note I would prefer a method that does not rely on the CLI tool.

like image 758
Dave Avatar asked Dec 02 '15 21:12

Dave


2 Answers

I suspect that it is sometimes unable to connect because I can see on the telnet that localhost is resolving to ipv6 first. have you tried:

./bin/jboss-cli.sh --connect controller=127.0.0.1:9990 command=:shutdown

Short of that you can always just kill the PID:

pgrep -d" " -f "wildfly" | xargs kill;
like image 144
teacurran Avatar answered Nov 13 '22 14:11

teacurran


To stop Wildfly:

$ ./jboss-cli.sh --connect command=:shutdown
like image 30
WizofOz Avatar answered Nov 13 '22 14:11

WizofOz