How to disable JBoss Wildfly when I cannot access the CLI tool?

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

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

In any case, from time to time I can’t access this tool, even though the server is still running. Check out 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 reliable way to disable the JBoss server? Note. I would prefer a method that is independent of the CLI tool.

+5
source share
2 answers

I suspect that sometimes it cannot connect, because I see on telnet that localhost first allows ipv6. you tried:

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

In short, you can always just kill the PID:

 pgrep -d" " -f "wildfly" | xargs kill; 
+14
source

To stop Wildfly:

 $ ./jboss-cli.sh --connect command=:shutdown 
+3
source

Source: https://habr.com/ru/post/1237284/


All Articles