+++ This bug was initially created as a clone of JBoss ON Bug #873494 +++ Description of problem: When service discovery is attempted for Microsoft IIS, it fails with the following exception: 2012-11-06 03:49:11,644 WARN [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Failure during discovery for [VHost] Resources - failed after 281 ms. java.lang.Exception: Discovery component invocation failed. at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:297) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.hyperic.sigar.win32.Win32Exception: MetaBaseInit: Can't CoCreateInstance at org.hyperic.sigar.win32.MetaBase.MetaBaseInit(Native Method) at org.hyperic.sigar.win32.MetaBase.<init>(MetaBase.java:59) at org.rhq.plugins.iis.util.IISMetaBase.getWebSites(IISMetaBase.java:75) at org.rhq.plugins.iis.IISVHostDiscoveryComponent.discoverResources(IISVHostDiscoveryComponent.java:62) at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:293) ... 5 more Version-Release number of selected component (if applicable): 4.4.0.JON310GA How reproducible: Always Steps to Reproduce: 1. Install IIS on Windows Server 2008 R2 2. Add ON agent to same machine 3. Import IIS server into ON inventory 4. Verify IIS server resource shows available in ON inventory Actual results: No child VHost resource listed under IIS server (by default, IIS 7+ adds a single default VHost. Additionally, the agent log will reveal a Sigar failure during discovery: org.hyperic.sigar.win32.Win32Exception: MetaBaseInit: Can't CoCreateInstance Expected results: Default IIS VHost resource under IIS Server resource in navigation tree and no failure message. Additional info: This issue was reproduces on a Windows Server 2008 64-bit installation both with a 32-bit JVM and a 64-bit JVM to confirm that the same issue exists in both the 32-bit and 64-bit Sigar DLLs. Additionally the test was repeated with the Sigar libraries shipped with the ON 3.0 agent to confirm that a rebuild of the libraries did not introduce a regression.
It looks like IIS 7.0 and higher use a different way for storing its internal configuration [1]. Our IIS plugin uses Sigar and Sigar uses Active Base Objects api for accessing the configuration stored in file Metabase.xml. IIS 7.0< stores the config data in applicationHost.config file, and by default is not backward compatible. However, the backward compatibility can be achieved by changing the "Web server" role. If checkbox "IIS 6.0 Metabase Compatibility" is checked, then Sigar is able to connect to the old api via JNI and everything works as it should. [1] http://programming4.us/website/3464.aspx