Problems with JMX plugin in AS 5.1.0.GA
jmesnil Jul 1, 2009 12:35 PMHi,
I want to create a jopr plug-in to manage JMX MBeans in Embedded Jopr in AS 5.1.0.GA.
I create the plugin jar with the config:
<depends plugin="JMX" /> <service name="Messaging Service" description="JBoss Messaging Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent"> <runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside> <plugin-configuration> <c:simple-property name="objectName" default="org.jboss.messaging:module=Core,type=Server" readOnly="true"/> </plugin-configuration> </service>
I've added it to deploy/admin-console.war/plugins.
I also copied the rhq-jmx-plugin-1.3.0-SNAPSHOT.jar to the plugins dir.
When I start JBoss and logged in the console, I got the error:
18:10:47,943 INFO [BootstrapAction] Initializing Administration Console v1.2.0.GA... 18:10:52,921 WARN [SystemInfoFactory] System info API not accessible on this platform (native shared library not found in java.library.path). 18:10:53,181 INFO [PluginContainerResourceManager] Discovering Resources... 18:10:53,269 WARN [JMXDiscoveryComponent] Unable to complete base jmx server discovery (enable DEBUG for stack): java.lang.UnsupportedOperationException: No native library available - Cannot get the process table information without native support 18:11:01,815 INFO [RuntimeDiscoveryExecutor] Running runtime discovery scan rooted at platform... 18:11:03,903 ERROR [RuntimeDiscoveryExecutor] Unable to obtain discovery component for [ResourceType[id=0, category=Service, name=Messaging Service, plugin=JBossMessaging]] org.rhq.core.clientapi.agent.PluginContainerException: Could not find plugin class org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent] from plugin environment [PluginEnvironment[pluginName=JBossMessaging, pluginDesciptorLoader=PluginDescriptorLoader[pluginJarUrl=jndi:/localhost/admin-console/plugins/jopr-jboss-messaging-2-plugin-2.3.0-SNAPSHOT.jar, pluginClassLoader=org.rhq.core.pc.plugin.PluginClassLoader@61033952]]] at org.rhq.core.pc.plugin.PluginComponentFactory.instantiateClass(PluginComponentFactory.java:135) at org.rhq.core.pc.plugin.PluginComponentFactory.getDiscoveryComponent(PluginComponentFactory.java:78) at org.rhq.core.pc.inventory.RuntimeDiscoveryExecutor.discoverForResource(RuntimeDiscoveryExecutor.java:205) at org.rhq.core.pc.inventory.RuntimeDiscoveryExecutor.runtimeDiscover(RuntimeDiscoveryExecutor.java:134) at org.rhq.core.pc.inventory.RuntimeDiscoveryExecutor.call(RuntimeDiscoveryExecutor.java:94) at org.rhq.core.pc.inventory.RuntimeDiscoveryExecutor.call(RuntimeDiscoveryExecutor.java:51) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138)
It seems the JMX plugin is not properly initialized and thus my plugin is not initialized too.
Thanks to help on the #jopr IRC channel, I've been told to add sigar files ( libsigar-universal-macosx.dylib and sigar-*.jar) to make it work.
I copied them from JOPR 2.2 download from https://www.jboss.org/community/wiki/Jopr-Releases
I added the dylib the sigar jar to server/../lib but I got no more success.
I also add the dylib to LD_LIBRARY_PATH without success.
I make sure that the dylib is in java.libary.path but I still got the same error
What are the steps to be able to use the JMX plugin?
I don't understand why I'd need a native lib to be able to manage components through JMX...
(I'm on Mac OS X 10.5.7 but I've got the same issue on Linux)