5 Replies Latest reply: Sep 21, 2009 7:01 PM by Elias Ross RSS

Create plugin for Embedded Jopr

Elias Ross Master

I feel like a fool since I haven't gotten my crappy JMX plugin to work.

I based it off of this code:
http://svn.rhq-project.org/repos/rhq/trunk/etc/custom-jmx-plugin

But no luck on getting it to work. Looks like it depends on the JMX plugin.

So I tried to get the JMX plugin to deploy (and the Hibernate plugin to deploy.)

Based on a post in this forum, I added this to my plugin:

<runs-inside>
 <parent-resource-type name="JMX Server" plugin="JMX"/>
 <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
 <parent-resource-type name="JBossAS Server" plugin="JBossAS5"/>
 </runs-inside>


And I see this:
00:01:33,312 ERROR [PluginMetadataManager] Error transforming plugin descriptor [CustomJmx].
org.rhq.core.clientapi.agent.metadata.InvalidPluginDescriptorException: There is no resource type named [JBossAS Server] from a plugin named [JBossAS]; please check the descriptor of type [Logging Service]


Removing the line "JBossAS" I see:

I also see tons of these messages trying to hot deploy:
00:04:05,063 WARN [AbstractSynchAdapter] Could not delete previous file: ZipEntryHandler

Which I suppose is indicating hot deploy isn't. (Is this Seam related?)

I'm feeling a bit let down from the JavaOne presentations which suggested that the Embedded Jopr was somehow compatible with the non-embedded version. Not as far as I can see.


  • 1. Re: Create plugin for Embedded Jopr
    Elias Ross Master

    Sorry, what I see after removing "JBossAS" is:

     <runs-inside>
     <parent-resource-type name="JMX Server" plugin="JMX"/>
     <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
     <parent-resource-type name="JBossAS Server" plugin="JBossAS5"/>
     </runs-inside>
    


  • 2. Re: Create plugin for Embedded Jopr
    Elias Ross Master

    Paste not working. I see:

    00:12:39,935 WARN [InventoryManager] Failure during discovery for [Logging Service] Resources - failed after 1 ms.
    java.lang.Exception: Discovery component invocation failed.
     at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:248)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
     at java.util.concurrent.FutureTask.run(FutureTask.java:166)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
     at java.lang.Thread.run(Thread.java:636)
    Caused by: java.lang.ClassCastException: org.rhq.plugins.jbossas5.ApplicationServerComponent cannot be cast to org.rhq.plugins.jmx.JMXComponent
     at org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent.discoverResources(MBeanResourceDiscoveryComponent.java:96)
     at org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent.discoverResources(MBeanResourceDiscoveryComponent.java:84)
     at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:616)
     at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:244)
     ... 5 more
    



  • 3. Re: Create plugin for Embedded Jopr
    Lukas Krejci Novice

    Hi genman,

    I assume you're using embedded Jopr included with JBoss AS 5.1.0.GA. With that version, you're unfortunately going to run into these problems, because we've addressed them only after 5.1.0.GA was released.

    In that version, if a plugin defined a "runs-inside" element, all of the plugins mentioned there had to be present (this was mitigated by http://jira.rhq-project.org/browse/RHQ-2059).

    So to mitigate this exception:

    00:01:33,312 ERROR [PluginMetadataManager] Error transforming plugin descriptor [CustomJmx].
    org.rhq.core.clientapi.agent.metadata.InvalidPluginDescriptorException: There is no resource type na
    med [JBossAS Server] from a plugin named [JBossAS]; please check the descriptor of type [Logging Ser
    vice]
    


    you tried the right thing by removing the dependency on the JBossAS plugin (i.e. the plugin to manage AS4).

    But unfortunately that's not enough.

    The second exception, i.e.:
    00:12:39,935 WARN [InventoryManager] Failure during discovery for [Logging Service] Resources - fai
    led after 1 ms.
    java.lang.Exception: Discovery component invocation failed.
     at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComp
    onentProxyFactory.java:248)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
     at java.util.concurrent.FutureTask.run(FutureTask.java:166)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
     at java.lang.Thread.run(Thread.java:636)
    Caused by: java.lang.ClassCastException: org.rhq.plugins.jbossas5.ApplicationServerComponent cannot
    be cast to org.rhq.plugins.jmx.JMXComponent
     at org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent.discoverResources(MBeanResourceDiscoveryComp
    onent.java:96)
     at org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent.discoverResources(MBeanResourceDiscoveryComp
    onent.java:84)
     at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:616)
     at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComp
    onentProxyFactory.java:244)
     ... 5 more
    


    is caused by the fact, that the AS5 plugin included in admin console of 5.1.0.GA only works with in-process information provided by the ProfileService of AS5. That is, it doesn't support working with JMX (and that's exactly what you can read from that exception).

    Following this early version of the AS5 plugin we concentrated on making it full featured for Jopr 2.3.0 that has been recently released.

    But here's the temporary catch. Due to some bugs discovered in AS5 during this time, some changes have been made both on plugin and AS side, that make the AS5 plugin in Jopr 2.3.0 incompatible with JBoss AS 5.1.0.GA. These changes are included Jopr 2.3.0 on the plugin side and in trunk, EAP5 and AS 5.2 branch of the app server. AS5 plugin in Jopr 2.3.0 also implements JMXComponent so you shouldn't see the exception above with it.

    So in another words, to make your plugin work, you have to use EmbJopr 2.3.0 but that version doesn't work with JBoss AS 5.1.0.GA.

    The problem with incompatibilities between AS 5.1.0.GA and Jopr 2.3.0 has been discussed for example in here http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255916#4255916. You can try downloading the EAP5 trial and see if it helps in your situation like it did zbiggy in that topic.


  • 4. Re: Create plugin for Embedded Jopr
    mazz Master

    FYI: Jopr 2.3.0 has been superceded by Jopr 2.3.1. Don't use Jopr 2.3.0 if you've got its binary distro (we've removed it from the downloads list) - get Jopr 2.3.1.

    Another FYI: in 2.3.1, we've introduced the concept of "optional" vs. "required" dependencies. Before 2.3.1, any time a plugin referenced another plugin, that other plugin was required to be deployed too (along with your plugin). But now, 2.3.1 introduces the concept of an "optional" dependency. Any plugin listed as a "sourcePlugin" or in a "runs-inside", it does not have to be deployed. If it isn't, it'll just be ignored. Only unless a plugin is listed in a "depends" tag is it required to exist. Most of the time, the JMX plugin is a required dependency (so it usually always must be deployed). Read this for more info:

    http://jopr.org/confluence/display/RHQ/AMPS-Plugin+Extensions#AMPS-PluginExtensions-PluginDescriptorContentThatDealsWithPluginExtensions

  • 5. Re: Create plugin for Embedded Jopr
    Elias Ross Master

    mazz - This is great news and I'm happy to see progress has been made in later releases of Jopr and JBoss AS.

    I'll try to test the EAP5 trial release and see if it works better for me. For now, I'm going to settle with administration using the JMX console. I don't support JBoss 5.1 is going to have a newer release?

    Maybe some of this information could also be posted in a FAQ.

    Thanks for your help!