Due to a recent update on Javascript code a full page refresh on your browser might be needed.
Bug 593000 - Inventoried JBossAS5 servers are not going green
Summary: Inventoried JBossAS5 servers are not going green
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 1.4
Hardware: All
OS: Linux
high
high vote
Target Milestone: ---
: ---
Assignee: John Sanda
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon-sprint10-bugs
TreeView+ depends on / blocked
 
Reported: 2010-05-17 15:10 UTC by John Sefler
Modified: 2010-08-12 16:58 UTC (History)
1 user (show)

Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-12 16:58:08 UTC


Attachments (Terms of Use)

Description John Sefler 2010-05-17 15:10:50 UTC
Description of problem:
For the past few builds of master, after auto discovering a running JBossAS5 server, the resource Availability remains "Unknown".  It never goes green.

Version-Release number of selected component (if applicable):
 RHQ
version: 3.0.0-SNAPSHOT
build number: 0f00f36 

How reproducible:


Steps to Reproduce:
1. Install a JBossAS5 server on a platform that you have already inventoried on your RHQ Server:
http://porkchop.devel.redhat.com/released/JBEAP-5.0/5.0.0.GA/zip/jboss-eap-5.0.0.GA.zip
unzip it
cd jboss-eap-5.0/jboss-as/bin/
vi ../server/default/conf/props/jmx-console-users.properties (UNCOMMENT #admin=admin)
./run.sh -b 0.0.0.0 -c default&


2. Manually auto discover on your platform
3. Import the auto discovered JBossAS5 server (e.g auto-rhq01.usersys.redhat.com:1099)
  
Actual results:
The server "Availability" status remains "Unknown".

Expected results:
It should go green

Additional info:
To verify that the JBossAS5 EAP server is really running, you can open its admin console: e.g. 
http://auto-rhq01.usersys.redhat.com:8080/admin-console

Comment 1 John Sanda 2010-05-18 17:15:49 UTC
Here is the exception(s) from my agent log.

2010-05-18 13:01:43,588 INFO  [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Detected new Server [Resource[id=0, type=JBossAS Server, key=/home/jsanda/Development/jboss-eap-5.0/jboss-as/server/default, name=localhost.localdomain:1099, parent=<null>, version=5.0.0.GA]] - adding to local inventory...
2010-05-18 13:01:43,592 ERROR [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Access to resource [Resource[id=0, type=JBossAS Server, key=/home/jsanda/Development/jboss-eap-5.0/jboss-as/server/default, name=localhost.localdomain:1099, parent=F12-laptop, version=5.0.0.GA]] will fail due to missing classloader
org.rhq.core.clientapi.agent.PluginContainerException: Failed to obtain classloader for resource: Resource[id=0, type=JBossAS Server, key=/home/jsanda/Development/jboss-eap-5.0/jboss-as/server/default, name=localhost.localdomain:1099, parent=F12-laptop, version=5.0.0.GA]
	at org.rhq.core.pc.plugin.PluginComponentFactory.getResourceClassloader(PluginComponentFactory.java:188)
	at org.rhq.core.pc.inventory.InventoryManager.initResourceContainer(InventoryManager.java:1221)
	at org.rhq.core.pc.inventory.InventoryManager.mergeResourceFromDiscovery(InventoryManager.java:1159)
	at org.rhq.core.pc.inventory.AutoDiscoveryExecutor.pluginDiscovery(AutoDiscoveryExecutor.java:190)
	at org.rhq.core.pc.inventory.AutoDiscoveryExecutor.call(AutoDiscoveryExecutor.java:104)
	at org.rhq.core.pc.inventory.AutoDiscoveryExecutor.call(AutoDiscoveryExecutor.java:70)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
	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:619)
Caused by: java.io.FileNotFoundException: Cannot find [/home/jsanda/Development/jboss-eap-5.0/jboss-as/lib/jboss-classpool.jar] - unable to manage server.
	at org.rhq.plugins.jbossas5.ApplicationServerDiscoveryComponent.getAdditionalClasspathUrls(ApplicationServerDiscoveryComponent.java:157)
	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.util.DiscoveryComponentProxyFactory$ResourceDiscoveryComponentInvocationHandler.invokeInCurrentThread(DiscoveryComponentProxyFactory.java:231)
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ResourceDiscoveryComponentInvocationHandler.invoke(DiscoveryComponentProxyFactory.java:196)
	at $Proxy79.getAdditionalClasspathUrls(Unknown Source)
	at org.rhq.core.pc.inventory.InventoryManager.invokeDiscoveryComponentClassLoaderFacet(InventoryManager.java:351)
	at org.rhq.core.pc.plugin.PluginComponentFactory.askDiscoveryComponentForAdditionalClasspathUrls(PluginComponentFactory.java:200)
	at org.rhq.core.pc.plugin.PluginComponentFactory.getResourceClassloader(PluginComponentFactory.java:184)
	... 12 more
2010-05-18 13:01:43,598 INFO  [InventoryManager.discovery-1] (rhq.core.pc.inventory.AutoDiscoveryExecutor)- Process scan auto-detected new server resource: scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.Main|match=.*], name=[JBoss4]], discovered-process=[process: pid=[32578], name=[/usr/java/jdk1.6.0_18/bin/java], ppid=[32541]]
2010-05-18 13:01:43,624 INFO  [InventoryManager.discovery-1] (rhq.core.pc.inventory.AutoDiscoveryExecutor)- Process scan auto-detected new server resource: scan=[ProcessScan: query=[process|basename|match=^(postgres|postmaster)$,process|basename|nomatch|parent=^(postgres|postmaster)$], name=[unix]], discovered-process=[process: pid=[1401], name=[postmaster], ppid=[1]]
2010-05-18 13:01:43,627 INFO  [ResourceDiscoveryComponent.invoker.daemon-3] (org.rhq.plugins.postgres.PostgresDiscoveryComponent)- Discovered a postgres process: ProcessScanResult: scan=[ProcessScan: query=[process|basename|match=^(postgres|postmaster)$,process|basename|nomatch|parent=^(postgres|postmaster)$], name=[unix]], info=[process: pid=[1401], name=[postmaster], ppid=[1]]
2010-05-18 13:01:43,627 WARN  [ResourceDiscoveryComponent.invoker.daemon-3] (org.rhq.plugins.postgres.PostgresDiscoveryComponent)- PostgreSQL data directory (/var/lib/pgsql/data) does not exist or cannot be read.
2010-05-18 13:01:43,693 WARN  [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Failure during discovery for [Postfix Server] Resources - failed after 11 ms.
java.lang.Exception: Discovery component invocation failed.
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:270)
	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:619)
Caused by: java.lang.IllegalStateException: Could not list files in /etc/postfix
	at org.rhq.augeas.util.Glob.match(Glob.java:128)
	at org.rhq.augeas.util.Glob.matchAll(Glob.java:145)
	at org.rhq.plugins.augeas.AugeasConfigurationDiscoveryComponent.checkFiles(AugeasConfigurationDiscoveryComponent.java:130)
	at org.rhq.plugins.augeas.AugeasConfigurationDiscoveryComponent.discoverResources(AugeasConfigurationDiscoveryComponent.java:63)
	at org.rhq.plugins.postfix.PostfixServerDiscoveryComponent.discoverResources(PostfixServerDiscoveryComponent.java:42)
	at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:266)
	... 5 more

Comment 2 John Sanda 2010-05-18 17:34:34 UTC
Looking at the plugin code, specifically the class ApplicationServerDiscoveryComponent I see that at some point support has been added for JBoss AS 6. The discovery component implements ClassLoaderFacet and when getAdditionalClasspathUrls() is invoked, the method looks for specific jars on the server. jboss-classpool.jar is/should be in a JBoss AS server installation, but it is not in JBoss AS 5 (at least I didn't find it). When getAdditionalClasspathUrls() fails to find one of the jar files that it is looking for, an exception is thrown which is what we see in comment 1. This method needs to be made more robust to differentiate between different versions of JBoss AS.

Comment 3 John Sanda 2010-05-18 18:54:07 UTC
Added logic to determine which jars to look for based on the JBoss AS version since there are some jars that are specific to AS 6.

commit hash: d6a1bdf05d4a688f11781ed270b1cf5109db27d2

Comment 4 Corey Welton 2010-05-20 20:06:03 UTC
QA Verified.  Great job, John.

Comment 5 Corey Welton 2010-08-12 16:58:08 UTC
Mass-closure of verified bugs against JON.


Note You need to log in before you can comment on or make changes to this bug.