2 Replies Latest reply: Sep 25, 2011 3:35 AM by michaelbini RSS

plugin help

michaelbini Newbie


I'm try to develop a plugin(any type of plugin will be ok this prosses is for studing rhq).

The operation system is windows 7 64bit.

(I try three different ways to achieve my goal)

as a starting point I download RHQ Plugin Generator.

this is the full descreption of my actions (with the Exception):

Please help me out am I missing something ?


C:\RHQ_httptest>java -jar rhq-pluginGen-3.0.2-SNAPSHOT-jar-with-dependencies.jar

Please specify the plugin root category PLATFORM(P), SERVER(S), SERVICE(I), s

Please specify its PackagePrefix: org.rhq.plugins

Please specify its FileSystemRoot: /jon

Please specify its ComponentClass: FooComponent

Please specify its DiscoveryClass: FooDiscovery

Please specify if it should support Events (y/N): y

Please specify its ParentType:

Please specify if it should support HasMetrics (y/N): y

Please specify if it should support HasOperations (y/N): y

Please specify if it should support Singleton (y/N): y

Please specify if it should support ResourceConfiguration (y/N): y

Please specify if it should support SupportFacet (y/N): y

Please specify if it should support CreateChildren (y/N): y

Please specify if it should support UsesExternalJarsInPlugin (y/N): y

Please specify if it should support DeleteChildren (y/N): y

Please specify if it should support ManualAddOfResourceType (y/N): y

Please specify if it should support UsePluginLifecycleListenerApi (y/N): y

Please specify if it should support DependsOnJmxPlugin (y/N): y

Please specify its RhqVersion: 1.3.0.GA

Please specify its PluginName: Demo

Please specify its PluginDescription: this is a demo

Please specify its Name: demo

Please specify its Description: this is a demo



Do you want to add a child to demo? (y/N)

22/09/2011 12:55:57 org.rhq.helpers.pluginGen.PluginGen run


You have choosen:

Props{category=SERVER, name='demo', description='this is a demo', packagePrefix='org.rhq.plugins', pkg='null', discoveryClass='Foo

Discovery', componentClass='FooComponent', parentType='null', fileSystemRoot='/jon', monitoring=true, operations=true, metricProps

=[], operationProps=[], singleton=true, resourceConfiguration=true, events=true, supportFacet=true, createChildren=true, deleteChi

ldren=true, usesExternalJarsInPlugin=true, manualAddOfResourceType=true, usePluginLifecycleListenerApi=true, dependsOnJmxPlugin=tr

ue, rhqVersion='1.3.0.GA', children=[], simpleProps=[], templates=[], runsInsides=[]}

22/09/2011 12:55:57 org.rhq.helpers.pluginGen.PluginGen generate

INFO: Generating...

22/09/2011 12:55:57 org.rhq.helpers.pluginGen.PluginGen createFile

INFO: Trying to generate C:\jon\demo/pom.xml

22/09/2011 12:55:57 org.rhq.helpers.pluginGen.PluginGen createFile

INFO: Trying to generate C:\jon\demo\src\main\resources\META-INF/rhq-plugin.xml

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 1

        at java.lang.String.charAt(Unknown Source)

        at java.util.regex.Matcher.appendReplacement(Unknown Source)

        at java.util.regex.Matcher.replaceAll(Unknown Source)

        at java.lang.String.replaceAll(Unknown Source)

        at org.rhq.helpers.pluginGen.PluginGen.toDirPath(PluginGen.java:318)

        at org.rhq.helpers.pluginGen.PluginGen.generate(PluginGen.java:274)

        at org.rhq.helpers.pluginGen.PluginGen.run(PluginGen.java:94)

        at org.rhq.helpers.pluginGen.PluginGen.main(PluginGen.java:55)



The second thing I did wes to download the Skeleton Plugin.

from here :


without changing anything in the plugin I try to build it using mvn install

but I am receving an error :


C:\skeleton-plugin>mvn install

[INFO] Scanning for projects...


[WARNING] Some problems were encountered while building the effective model for org.rhq.sample.skeletonplugin:skeleton-plugin:jar:


[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 113, column 15


[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.


[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.



[INFO] ------------------------------------------------------------------------

[INFO] Building Skeleton RHQ Plugin Template 1.0

[INFO] ------------------------------------------------------------------------

Downloading: http://repository.jboss.org/maven2/org/rhq/rhq-core-domain/1.0.0.GA/rhq-core-domain-1.0.0.GA.pom

Downloading: http://repository.jboss.org/maven2/org/rhq/rhq-core-plugin-api/1.0.0.GA/rhq-core-plugin-api-1.0.0.GA.pom

Downloading: http://repository.jboss.org/maven2/org/rhq/rhq-core-native-system/1.0.0.GA/rhq-core-native-system-1.0.0.GA.pom

Downloading: http://repository.jboss.org/maven2/hibernate-annotations/hibernate-annotations/3.2.1.GA/hibernate-annotations-3.2.1.G


[INFO] ------------------------------------------------------------------------


[INFO] ------------------------------------------------------------------------

[INFO] Total time: 4.030s

[INFO] Finished at: Thu Sep 22 13:29:13 IDT 2011

[INFO] Final Memory: 4M/58M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal on project skeleton-plugin: Could not resolve dependencies for project org.rhq.sample.skeletonplugi

n:skeleton-plugin:jar:1.0: Failed to collect dependencies for [org.rhq:rhq-core-domain:jar:1.0.0.GA (provided), org.rhq:rhq-core-p

lugin-api:jar:1.0.0.GA (provided), org.rhq:rhq-core-native-system:jar:1.0.0.GA (provided), javax.persistence:persistence-api:jar:1

.0 (provided), hibernate-annotations:hibernate-annotations:jar:3.2.1.GA (provided), javax.xml.bind:jaxb-api:jar:2.1 (provided), co

mmons-logging:commons-logging:jar:1.1 (provided)]: Failed to read artifact descriptor for org.rhq:rhq-core-domain:jar:1.0.0.GA: Co

uld not transfer artifact org.rhq:rhq-core-domain:pom:1.0.0.GA from/to jboss (http://repository.jboss.org/maven2/): Access denied

to: http://repository.jboss.org/maven2/org/rhq/rhq-core-domain/1.0.0.GA/rhq-core-domain-1.0.0.GA.pom -> [Help 1]


[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.


[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException




the third thing I try to do is folling this guide :


I download the zip file :


and try to install but still I am getting errors.


[INFO] Scanning for projects...

[ERROR] The build could not read 1 project -> [Help 1]


[ERROR]   The project org.rhq:rhq-httptest-plugin:1.0.1-SNAPSHOT (C:\RHQ_httptest\pom.xml) has 1 error

[ERROR]     Non-resolvable parent POM: Could not find artifact org.rhq:rhq-plugins-parent:pom:1.0.1-SNAPSHOT and 'parent.relativeP

ath' points at wrong local POM @ line 5, column 12 -> [Help 2]


[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.


[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException



I feel like it doesn't matter what I'm do I can't get it to create simple plugin.



Michael Bini

  • 1. Re: plugin help
    Heiko Rupp Master


    it is sad that you had such a bad experience when starting to write a plugin. The blog post you mention in part 3 is relatively old and we have changed some maven pom things where it looks like you are stumbling upon. In Option 1 you clearly run into a bug - I will look into that as soon as I can.


    Currently the best bet is perhaps to take a plugin like hibernate, copy everything over into a parallel subtree below modules/plugins/ and rename hibernate all over by the name of your plugin.


    Thanks for pointing that out and I will get back to you when the issue with the plugin generator is solved - especially as the input you have pasted in looks pretty valid. Just curious: what jdk are you using?


    Sorry for the inconvenience



  • 2. Re: plugin help
    michaelbini Newbie

    Hi Heiko,

    Thank's for your answer, I will try to use hibernate in order to generate my own plugin.

    my system info:

    windows 7 64 bit.

    java -version :

    java version "1.6.0_22"

    Java(TM) SE Runtime Environment (build 1.6.0_22-b04)

    Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)

    If there any other information you need from me please let me know.


    Michael Bini