java.lang.RuntimeException: Server failed to shutdown at org.jboss.on.plugins.tomcat.TomcatServerOperationsDelegate.shutdown(TomcatServerOperationsDelegate.java:281) at org.jboss.on.plugins.tomcat.TomcatServerOperationsDelegate.shutdown(TomcatServerOperationsDelegate.java:274) at org.jboss.on.plugins.tomcat.TomcatServerOperationsDelegate.invoke(TomcatServerOperationsDelegate.java:128) at org.jboss.on.plugins.tomcat.TomcatServerComponent.invokeOperation(TomcatServerComponent.java:424) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
STR: 1) Install Tomcat on RHEL 6 from RPM, inventorize. Follow https://docspace.corp.redhat.com/docs/DOC-61584 2) Configure JMX Follow https://docspace.corp.redhat.com/docs/DOC-60338 6) + 7) 3) Invoke Tomcat's Shutdown operation. It will fail with the exception above. To save you opening Docspace, the config I used is this: Manager URL = service:jmx:rmi:///jndi/rmi://localhost:<PORT>/jmxrmi (same as normal) Control Method = RPM System V init script Start Script = /usr/sbin/tomcat6 Shutdown Script = /usr/sbin/tomcat6
Also see https://issues.jboss.org/browse/JBPAPP-6089 and pls provide additional information if the above setup is wrong. http://documentation-stage.bne.redhat.com/docs/en-US/JBoss_Enterprise_Web_Server/1.0/html-single/Installation_Guide/index.html#ch-Monitoring_with_JBoss_Operating_Network
confirmed. This is because the plugin cannot figure out the version of the RPM-based tomcat install.
Note that this is currently only in master. commit 884eb4f2a4a609ff9541d9d8693133f79518a520 Author: Lukas Krejci <lkrejci> Date: Wed Nov 23 15:26:04 2011 +0100 [BZ 690957] - EWS Tomcat is identical to "normal" tomcat when installed through RPM (at least wrt system services installed) Make sure that the operation execution logic doesn't get confused by not being able to distinguish between them.
Mike can you have this tested in master so we can get it into the release branch, assuming it verifies
I am using below version JON and still getting this error. does this exist previous builds also. Also is there a fix avaialbe for this. version: 2.4.1.GA build number: 11140:81e26be20d thanks, Praveen
VERIFIED: JON 3.2.0.ER5 + EWS 2.0.1 Tomcat6 from RPM + RHEL 6.4 (x86_64) + OpenJDK 1.6 NOT VERIFIED: JON 3.2.0.ER5 + EWS 2.0.1 Tomcat7 from RPM + RHEL 6.4 (x86_64) + OpenJDK 1.6 It shows Operation status failed in JON HTML UI: java.lang.RuntimeException: Script returned error or non-zero exit code while shutting down the Tomcat instance. Exit code [1] at org.jboss.on.plugins.tomcat.TomcatServerOperationsDelegate.doShutdown(TomcatServerOperationsDelegate.java:314) at org.jboss.on.plugins.tomcat.TomcatServerOperationsDelegate.shutdown(TomcatServerOperationsDelegate.java:279) at org.jboss.on.plugins.tomcat.TomcatServerOperationsDelegate.shutdown(TomcatServerOperationsDelegate.java:275) at org.jboss.on.plugins.tomcat.TomcatServerOperationsDelegate.invoke(TomcatServerOperationsDelegate.java:129) at org.jboss.on.plugins.tomcat.TomcatServerComponent.invokeOperation(TomcatServerComponent.java:453) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:622) at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocation.call(ResourceContainer.java:654) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:701) Configuration in JON Tomcat config: Control Method: RPM System V init script Start Script: /usr/sbin/tomcat7 Stop Script: /usr/sbin/tomcat7
Fixed by https://github.com/rhq-project/rhq/pull/10
I am receiving still the same error when i want to shutdown EWS tomcat7 installed from RPM. I am receiving error in catalina.out: Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 8100; nested exception is: java.net.BindException: Address already in use It the same with RPM tomcat6. Tested environment: JON 3.2.0.GA+update02 + Tomcat plugin update-01 + EWS 2.1.0.ER4 Tomcat6/7 from RPM + RHEL 5 (x86_64) + OpenJDK 1.7
Note: port 8100 is from jmx configured for Tomcat. There is no opened port 8100 when i shutdown tomcat.
comm#11 and #12 - Tomcat was running under tomcat user and JON agent under root user.
It was my bad configuration. I set up jmx properties in /etc/tomcatX/tomcatX.conf JAVA_OPTS section. Its bad because it sets up JAVA_OPTS during start and also shutdown operation. Correct configuration for JON monitoring RPM EWS Tomcat is (X is tomcat version): 1. Set up jmx JAVA_OPTS properties in /usr/sbin/tomcatX script in section start and start-security. example: .... if [ "$1" = "start" ]; then JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=8100 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxr emote.access.file="/etc/tomcatX/jmxremote.access" -Dcom.sun.management.jmxremote.password.file="/etc/tomcatX/jmxremote.password"" ${JAVACMD} $JAVA_OPTS $LOGGING_CONFIG $CATALINA_OPTS \ -classpath "$CLASSPATH" \ -Dcatalina.base="$CATALINA_BASE" \ -Dcatalina.home="$CATALINA_HOME" \ -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \ -Djava.io.tmpdir="$CATALINA_TMPDIR" \ org.apache.catalina.startup.Bootstrap start \ >> ${CATALINA_BASE}/logs/catalina.out 2>&1 & if [ ! -z "$CATALINA_PID" ]; then echo $! > $CATALINA_PID fi elif [ "$1" = "start-security" ]; then JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=8100 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxr emote.access.file="/etc/tomcat6/jmxremote.access" -Dcom.sun.management.jmxremote.password.file="/etc/tomcat6/jmxremote.password"" ${JAVACMD} $JAVA_OPTS $LOGGING_CONFIG $CATALINA_OPTS \ -classpath "$CLASSPATH" \ -Dcatalina.base="$CATALINA_BASE" \ .... 2. Set Tomcat to run under root user in /etc/tomcatX/tomcatX.conf # What user should run tomcat TOMCAT_USER="root" 3. Start tomcat by command service tomcatX start under root user 4. Start JON agent under root user 5. Import JON agent and tomcat to JON server from JON HTML UI 6. Setup Tomcat connection configuration (principal and credentials) in JON UI 7. Setup Tomcat Control method configuration to RPM System V init script (note: Start and Shutdown script may not be set because Tomcat plugin always run service tomcatX start/stop command if we are using RPM System V init script) That's it
VERIFIED on RHEL5 x86_64 + JON 3.2.0.GA (update02) + JON Tomcat plugin (update01) + OpenJDK 1.7 + EWS RPM Tomcat6/7
Mandar please document steps from comm#14
VERIFIED on RHEL7 x86_64 + JON 3.2.0.GA (update02) + JON Tomcat plugin (update01) + OpenJDK 1.7 + EWS RPM Tomcat6/7
bug cloned for documentation. bz#1122005
added doc text.
This fix, change, or update was tested and released in Web Server Plugin Pack Update-01 for JBoss ON 3.2 -- https://access.redhat.com/jbossnetwork/restricted/softwareDetail.html?softwareId=32543