Bug 865488

Summary: Incorrectly detected connectors of tomcat7
Product: [JBoss] JBoss Enterprise Web Server 2 Reporter: Jan Martiska <jmartisk>
Component: JON PluginAssignee: Jean-frederic Clere <jclere>
Status: CLOSED DUPLICATE QA Contact: Mike Foley <mfoley>
Severity: urgent Docs Contact:
Priority: high    
Version: unspecifiedCC: ccrouch, jclere, jdoyle, lfuka, loleary, mfoley, mhasko, myarboro
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-12 17:36:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Martiska 2012-10-11 14:59:11 UTC
After I inventorize a tomcat 7 [bundled with EWS 2.0.0.CR1] instance and set up remote JMX connection to it,  its (HTTP|AJP) connectors appear unavailable. This message appears in the agent's log repeatedly over time:

012-10-11 10:44:27,262 DEBUG [InventoryManager.availability-1] (rhq.core.pc.inventory.AvailabilityExecutor)- Failed to collect availability on Resource[id=10196, uuid=e16d494d-5c81-43fa-9d49-403aef675fc2, type={Tomcat}Tomcat Connector, key=Catalina:port=8009,type=Connector, name=?-8009, parent=Tomcat (8080)]
org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException: Failed to start component for resource Resource[id=10196, uuid=e16d494d-5c81-43fa-9d49-403aef675fc2, type={Tomcat}Tomcat Connector, key=Catalina:port=8009,type=Connector, name=?-8009, parent=Tomcat (8080)].
	at org.rhq.core.pc.inventory.InventoryManager.activateResource(InventoryManager.java:1749)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.checkInventory(AvailabilityExecutor.java:298)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.checkInventory(AvailabilityExecutor.java:353)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.checkInventory(AvailabilityExecutor.java:353)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.call(AvailabilityExecutor.java:149)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.run(AvailabilityExecutor.java:98)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:679)
Caused by: org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException: The connector is not listening for requests on the configured port. This is most likely due to the configured port being in use at Tomcat startup. In some cases (AJP connectors) Tomcat will assign an open port. This happens most often when there are multiple Tomcat servers running on the same platform. Check your Tomcat configuration for conflicts: Catalina:port=8009,type=Connector
	at org.jboss.on.plugins.tomcat.TomcatConnectorComponent.start(TomcatConnectorComponent.java:113)
	at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:634)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	... 3 more

.. but the connector is in reality fully working and listening on that port. Also I noticed that JON detects the connector's "handler" attribute as "?" - that is quite likely connected to this issue somehow. The ObjectName of the connector, eg. Catalina:type=Connector,port=8080, is detected correctly.

Also, if I for example try to invoke the 'stop' operation on the connector, I get this error in agent's log:

2012-10-11 10:54:40,413 DEBUG [OperationManager.invoker-1] (rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler)- Call to [org.jboss.on.plugins.tomcat.TomcatConnectorComponent.invokeOperation()] with args [[stop, Configuration[id=0]]] failed.
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:262)
	at java.util.concurrent.FutureTask.get(FutureTask.java:119)
	at org.rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler.invokeInNewThreadWithLock(ResourceContainer.java:554)
	at org.rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler.invoke(ResourceContainer.java:542)
	at $Proxy63.invokeOperation(Unknown Source)
	at org.rhq.core.pc.operation.OperationInvocation.run(OperationInvocation.java:217)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.NullPointerException
	at org.rhq.plugins.jmx.MBeanResourceComponent.loadBean(MBeanResourceComponent.java:175)
	at org.rhq.plugins.jmx.MBeanResourceComponent.getEmsBean(MBeanResourceComponent.java:137)
	at org.rhq.plugins.jmx.MBeanResourceComponent.invokeOperation(MBeanResourceComponent.java:524)
	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:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:634)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	... 3 more

Comment 1 mark yarborough 2012-11-12 20:22:35 UTC
This bug needs a corresponding bug in Jira or Bz (as appropriate) owned by the plugin team. Mark Yarborough work with John Doyle to define EWS owner.

Comment 2 Rémy Maucherat 2012-12-14 16:31:54 UTC
Both work for me now, and were likely caused by bad mbean names. The mbean names got fixed by the Tomcat 7 support patch. If there is a problem, a new bug should be filed using a build that uses the RHQ version that has acked support for Tomcat 7.

Comment 3 Libor Fuka 2013-01-18 12:50:03 UTC
Do we have this patch in EWS 2.0.0.GA Jean Frederic ?

Comment 4 Libor Fuka 2013-01-18 13:21:44 UTC
or is it bug in JON EWS pluging ?

Comment 5 Jean-frederic Clere 2013-01-21 08:44:49 UTC
According to Remy it is working without any patch on EWS side.

Comment 6 Libor Fuka 2013-01-24 07:25:52 UTC
OK, Its a bug in EWS/Tomcat plugin, patch exists but it was not included in JON 3.1.2 EWS Plugin. Please keep open this bug and add this patch to next release of JON EWS Plugin.

Comment 7 mark yarborough 2013-03-04 21:34:25 UTC
Confirm if this bug still exists, and if so ensure EWS bug is open to track it (is not a JON bug)....

Comment 8 Libor Fuka 2013-03-05 09:27:12 UTC
This bug still exixst and i m not sure if this is bug in EWS tomcat or in JON EWS plugin.
Jean Frederic, can you confirm if its a bug in EWS 2.0 Tomcat7 ?

Comment 9 Jean-frederic Clere 2013-03-13 15:27:18 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=707349#c18

the patch wasn't merged in the branch so wasn't fixed :-(

Comment 10 Larry O'Leary 2013-03-13 18:12:21 UTC
*** Bug 921191 has been marked as a duplicate of this bug. ***

Comment 12 Larry O'Leary 2013-04-12 17:36:49 UTC
Closing this as it duplicates the already cloned bug that had been captured in EWS.

*** This bug has been marked as a duplicate of bug 921194 ***