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
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
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.
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
Fixed in master commit a3480101861ae6aed8f20d9010507602796504cc Author: Thomas Segismont <tsegismo> Date: Thu Jun 12 23:48:37 2014 +0200 Instead of importing tons of Query Cache resources, AS7 plugin will mimic Hibernate Plugin's behavior and expose a "viewQueries" operation to gather the Query Cache nodes statistics. Added HibernatePersistenceUnitComponent to implement "viewQueries" operation. The operation processes Query Cache nodes in batches to avoid sending too many queries to the management interface Deleted the never used QueryCacheDiscovery class (updated API check file accordingly) Removed the commented-out Query Cache service in AS7 plugin descriptor and added the "viewQueries" operation on the Hibernate Persistence Unit service Added itest for the "viewQueries" operation
Bulk close of items fixed in RHQ 4.12 If you think this is not solved, then please open a *new* BZ and link to this one.