Details
-
Bug
-
Resolution: Done
-
Major
-
EAP 5.0.0
-
None
-
RHEL
-
-
Not Required
Description
The method for stopping JBoss through the jboss_init_redhat.sh command has changed for 5.0; in 4.3, the script does a process grep and then sends a kill 15 to the pid. In 5.0, the method has changed to:
JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}
Results of two test cases:
1. Using the init script without the optional JBOSS_HOST option added, start the server with "/etc/init.d/jboss_init_redhat.sh start". This will work, and the server will bind to localhost and start correctly.
Wait for the server to finish starting, and then run "/etc/init.d/jboss_init_redhat.sh stop". The following exception will be thrown:
JBOSS_CMD_START = cd /opt/jboss/jboss-eap-5.0/jboss-as/bin; /opt/jboss/jboss-eap-5.0/jboss-as/bin/run.sh -c production
Exception in thread "main" java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console
at org.jboss.jmx.connector.invoker.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:88)
2. Using the init script with the optional JBOSS_HOST option added, start the server with "/etc/init.d/jboss_init_redhat.sh start". This will work, and the server will bind to $JBOSS_HOST and start correctly.
Wait for the server to finish starting, and then run "/etc/init.d/jboss_init_redhat.sh stop". The following exception will be thrown:
JBOSS_CMD_START = cd /opt/jboss/jboss-eap-5.0/jboss-as/bin; /opt/jboss/jboss-eap-5.0/jboss-as/bin/run.sh -c production -b <$JBOSS_HOST>
Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]]]
I can (very dirtily) hack around this by changing the "JBOSS_CMD_STOP...." line and adding the -s, -u, and -p commands, eg.:
JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown -s jnp://$JBOSS_HOST:1099 -u <user> -p <password>"
However, this seems like a sub-optimal solution.