+++ This bug was initially created as a clone of Bug #1033130 +++ Description of problem: An exception is thrown during discovery of Query Cache resources of RHQ Server resource Version-Release number of selected component (if applicable): 4.10-SNAPSHOT How reproducible: Always Steps to Reproduce: 1.Inventory RHQ Server resource 2.Watch the agent logs Actual results: 2013-11-21 15:09:30,315 WARN [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Failure during discovery for [Query Cache] Resources - failed after 75 ms. java.lang.Exception: Discovery component invocation failed. at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:307) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.IllegalArgumentException: Plugin error: Resource key [deployment=rhq.ear,subdeployment=rhq-core-domain-ejb3.jar,subsystem=jpa,hibernate-persistence-unit=rhq.ear/rhq-core-domain-ejb3.jar#rhqpu,query-cache=SELECT_space_COUNT_left_paren__star__right_paren__newline_FROM_space_AlertDefinition_space_alertdefinition_newline_WHERE_space__left_paren__space_alertdefinition.group.id_space_IN_space__left_paren__space__colon_resourceGroupIds_space__right_paren__space__newline_AND_space_alertdefinition.deleted_space__equal__space__colon_deleted_space__right_paren__newline_] specified by [ResourceType[id=0, name=Query Cache, plugin=JBossAS7, category=Service]] discovery component is longer than the maximum length (500). at org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails.setResourceKey(DiscoveredResourceDetails.java:143) at org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails.<init>(DiscoveredResourceDetails.java:95) at org.rhq.modules.plugins.jbossas7.SubsystemDiscovery.discoverResources(SubsystemDiscovery.java:158) at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:303) ... 4 more Expected results: No exception and successful discovery of all Query Cache resources --- Additional comment from Thomas Segismont on 2013-11-21 10:33:00 EST --- This could not happen before the fix for BZ1022409 because the whole "Hibernate Persistence Unit" resource was not discovered. We're hitting the max length for resource keys --- Additional comment from Thomas Segismont on 2013-11-28 09:18:57 EST --- Fixed in master commit 583c119780e0d69727de6c2a7bd6aaca33b22b69 Author: Thomas Segismont <tsegismo> Date: Thu Nov 28 15:18:06 2013 +0100 Query Cache management nodes have a very long name. So the default discovery class was creating a too long resource key and name. Now there is a dedicated discovery class for Query Cache resources and the resource key and name are just the hash of the query-name attribute. --- Additional comment from Thomas Segismont on 2013-12-06 10:28:27 EST --- Back to ON_DEV as we figured out that for the RHQ Server resource only, 2000+ Query cache resources are inventoried. The resource type will be commented out until we find a proper solution. commit c7a1bad920666b9aec331441fef7da7d38c5f443 Author: Thomas Segismont <tsegismo> Date: Fri Dec 6 16:25:21 2013 +0100
After some discussion, we've decided this type should be removed from 3.2.x as it has been for master/3.3. Any resources of this type will be removed on plugin update. commit 14582be95876bf79b9a4ccf7b2a3b4bf14974517 Author: Jay Shaughnessy <jshaughn> Date: Tue Jun 10 15:40:26 2014 -0400 Comment out Query Cache resource type (perf issue) For the RHQ Server resource only, 2000+ Query cache resources are inventoried The resource type will be commented out until we find a proper solution. Conflicts: modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml Cherry-Pick master c7a1bad920666b9aec331441fef7da7d38c5f443
Will cherry-pick the final fix from Bug 1033130 See https://bugzilla.redhat.com/show_bug.cgi?id=1033130#c4
Fixed in release/jon3.2.x commit 4929d1397d7bd7b2753b52ebc3988f7e87a75efe Author: Thomas Segismont <tsegismo> Date: Thu Jun 12 23:48:37 2014 +0200 (cherry picked from commit a3480101861ae6aed8f20d9010507602796504cc)
Verified on version : 3.2.0.GA Update 02 Build Number : dfe3e4b:cf4474c Deployed sample JavaEE6 application (javaee6-test-app.war) to EAP6 managed server. When the application is discovered, "Hibernate Persistence Unit" service was avaialble under "JPA" service. Verified that the 'Hibernate Persistence Unit' service has the 'view queries' operation and it shows success after scheduling. The stack trace is not observed in agent log after 'view queries' operation.