[xwiki-users] Installing components
Hi, I'm new to XWiki (and Maven, for that matter) and would like to write a component. I've gone through the Writing XWiki Components tutorial and the Building XWiki from sources page and also found this helpful post: http://n2.nabble.com/Components-in-XWiki-td2621693.html#a2621693. I generated the sample org.xwiki.component.HelloWorld component from the archetype in the tutorial, compiled it using the Maven Eclipse plugin, then dropped the jar in my WEB-INF\lib. But when I try to load the component with the sample script: {{groovy}} def greeter = com.xpn.xwiki.web.Utils.getComponent(org.xwiki.component.HelloWorld.class); {{/groovy}} I get exceptions saying "Failed to load component [org.xwiki.component.HelloWorld] for hint [default]" and "Can't find descriptor for the component [role = [org.xwiki.component.HelloWorld] hint = [default]]" I've also tried adding the @ComponentRole and @Component annotations (with no hints) to HelloWorld.java and DefaultHelloWorld.java which weren't there before, and also adding org.xwiki.component.HelloWorld to the plugins in xwiki.cfg, but this doesn't seem to change anything. What am I missing to successfully load the component? Much thanks, David Breeden -- View this message in context: http://n2.nabble.com/Installing-components-tp3811159p3811159.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi David, breeden wrote:
Hi,
I'm new to XWiki (and Maven, for that matter) and would like to write a component. I've gone through the Writing XWiki Components tutorial and the Building XWiki from sources page and also found this helpful post: http://n2.nabble.com/Components-in-XWiki-td2621693.html#a2621693. I generated the sample org.xwiki.component.HelloWorld component from the archetype in the tutorial, compiled it using the Maven Eclipse plugin, then dropped the jar in my WEB-INF\lib. But when I try to load the component with the sample script:
{{groovy}} def greeter = com.xpn.xwiki.web.Utils.getComponent(org.xwiki.component.HelloWorld.class); {{/groovy}}
I get exceptions saying "Failed to load component [org.xwiki.component.HelloWorld] for hint [default]" and "Can't find descriptor for the component [role = [org.xwiki.component.HelloWorld] hint = [default]]"
I've also tried adding the @ComponentRole and @Component annotations (with no hints) to HelloWorld.java and DefaultHelloWorld.java which weren't there before, and also adding org.xwiki.component.HelloWorld to the plugins in xwiki.cfg, but this doesn't seem to change anything.
What am I missing to successfully load the component?
Do you have the META-INF/components.txt file in your jar? Marius
Much thanks, David Breeden
Aha, the archetype provided in the tutorial generated META-INF/plexus/components.xml. After adding META-INF/components.txt, it is working. Very cool. Thanks so much! ~David Marius Dumitru Florea (via Nabble) wrote:
Hi David,
breeden wrote:
Hi,
I'm new to XWiki (and Maven, for that matter) and would like to write a component. I've gone through the Writing XWiki Components tutorial and the Building XWiki from sources page and also found this helpful post: http://n2.nabble.com/Components-in-XWiki-td2621693.html#a2621693. I generated the sample org.xwiki.component.HelloWorld component from the archetype in the tutorial, compiled it using the Maven Eclipse plugin, then dropped the jar in my WEB-INF\lib. But when I try to load the component with the sample script:
{{groovy}} def greeter =
com.xpn.xwiki.web.Utils.getComponent(org.xwiki.component.HelloWorld.class);
{{/groovy}}
I get exceptions saying "Failed to load component [org.xwiki.component.HelloWorld] for hint [default]" and "Can't find descriptor for the component [role = [org.xwiki.component.HelloWorld] hint = [default]]"
I've also tried adding the @ComponentRole and @Component annotations (with no hints) to HelloWorld.java and DefaultHelloWorld.java which weren't there before, and also adding org.xwiki.component.HelloWorld to the plugins in xwiki.cfg, but this doesn't seem to change anything.
What am I missing to successfully load the component?
Do you have the META-INF/components.txt file in your jar?
Marius
Much thanks, David Breeden
_______________________________________________ users mailing list [hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3814337&i=0> http://lists.xwiki.org/mailman/listinfo/users
------------------------------------------------------------------------ View message @ http://n2.nabble.com/Installing-components-tp3811159p3814337.html To unsubscribe from Installing components, click here < (link removed) >.
-- View this message in context: http://n2.nabble.com/Installing-components-tp3811159p3816761.html Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (2)
-
breeden -
Marius Dumitru Florea