Hello Team,
Edit: 2018/07/26 - Ensure JAVA_HOME is defined in jboss-cli.sh (jboss-cli.bat) file; if not available as an OS environmental variable. Example: JAVA_HOME="/opt/CA/jdk1.8.0_71"
- The jboss-cli.sh file is not auto-updated with JAVA_HOME variable upon installed of IM solution.
- Note: standalone.sh is auto updated with JAVA_HOME variable.
See example below: JBOSS/Wildfly default management port (localhost:9990) used to shutdown JBOSS/Wildfly via jboss-cli.sh process.

# Original discussion below #
While working with customer and various dev-ops processes, one area I see that needs attention is awareness that shudown processes for JBOSS/Wildfly may need to be updated.
The IM solution will, OOTB, update the startup files file; but assumes no changes to the shutdown processes.
However, if any port is changed, then there is the possibility the hard-coded ports in the JBOSS shutdown process may have been missed.
As a test if your shutdown processes are working fine, execute the following steps:
0) Check which ports are in use: {assumes JBOSS is running}
(win) netstat -an | findstr 8080 [Jboss default HTTP Port] or (linux) netstat -an | grep 8080
(win) netstat -an | findstr 9990 [Jboss management Port] or (linux) netstat -an | grep 9990
1) JBOSS_HOME\bin\jboss-cli.bat (jboss-cli.sh)
2) At the [disconnected /] prompt, type connnect
3) The prompt should change to [standalone@localhost:9990 /] This port number was pulled from jboss-cli.xml
4) Type shutdown
5 ) Type exit
6) See if the JBOSS instance is shutting down.
(win) netstat -an | findstr 8080 [Jboss default HTTP Port] or (linux) netstat -an | grep 8080
(win) netstat -an | findstr 9990 [Jboss management Port] or (linux) netstat -an | grep 9990
Or execute in one step: JBOSS_HOME\bin\jboss-cli.bat --connect command=:shutdown
Note: To use other ports, with out modification of the JBOSS_HOME\standalone\configuration\standalone*.xml file, the following may be done. This is useful when you need to run two solutions, but do not wish to share a single JBOSS server instance with two EAR deployments. Use two (2) JBOSS deployment with different ports.
WINDOWS VERSION OF JBOSS
Note: No need to update JBOSS_HOME\standalone\configuration\standalone*.xml
•Port Offset is already in the latest releases of JBOSS/Wildfly
Update JBOSS_HOME\bin\standalone.conf.bat to use port offset 100
•On Windows (otherwise update standalone.conf on Linux)
•Add set "JAVA_OPTS=%JAVA_OPTS% -Djboss.socket.binding.port-offset=100"
•Example:
•rem set "JAVA_OPTS=-Xms64M -Xmx512M -XX:MaxPermSize=256M"
•set "JAVA_OPTS=-Xms64M -Xmx2048M"
•rem # Prefer IPv4
•set "JAVA_OPTS=%JAVA_OPTS% -Djava.net.preferIPv4Stack=true"
•rem # Add offset to avoid collision with IM on port 8080 for IDP
•set "JAVA_OPTS=%JAVA_OPTS% -Djboss.socket.binding.port-offset=100"
Update JBOSS_HOME\bin\jboss-cli.xml to use shutdown port 10090
•Search replace 9990 with 10090 (assumes port offset=100)
Update JBOSS_HOME\bin\service\service.bat to use shutdown port 10090
•Update Names & Description for NT Service to avoid generic names
•Search replace 9990 with 10090 (assumes port offset=100)
•Then execute service.bat install to create NT service. Update to automatic start manually or via sc command.
See if the JBOSS instance is shutting down with the port offset of 100.
(win) netstat -an | findstr 8180 [Jboss default HTTP Port] or (linux) netstat -an | grep 8180
(win) netstat -an | findstr 10090 [Jboss management Port] or (linux) netstat -an | grep 10090
These steps will ensure that JBOSS is shutdown cleanly.
Benefit: Avoid startup issues with "corrupt" JMS queue entries when JBOSS service/daemon is "killed" instead of shutdown cleanly.
Cheers,
A.