Hi all,
first of all, thanks for the great work, xwiki is a great product
i'm trying to integrate the rendering component of xwiki into our
application for hours, without success.
I included all the libraries from XWiki 2.0 M4 and was running
following code in a standalone application (not within servlet
container, but thats no problem?)
--
EmbeddableComponentManager componentManager = new EmbeddableComponentManager();
componentManager.initialize(this.getClass().getClassLoader());
Parser parser = (Parser)componentManager.lookup(Parser.class,
Syntax.XWIKI_2_0.toIdString());
XDOM xdom = parser.parse(new StringReader("test"));
// Generate XHTML
PrintRendererFactory rf = componentManager.lookup(PrintRendererFactory.class,
Syntax.XHTML_1_0.toIdString());
DefaultWikiPrinter printer = new DefaultWikiPrinter();
Renderer htmlRenderer = rf.createRenderer(printer);
// Perform the rendering - the exception is raised here
xdom.traverse(htmlRenderer);
--
The stacktrace is attached below. The DocumentAccessBridge component
cannot be loaded. I tried to figure out what is going on and debugged
around. The loop that loads all descriptors for xwiki components
doesnt include DocumentAccessBridge. There is no
META-INF/components.txt in the xwiki-core-bridge-2.0-milestone-4.jar
and no class in this library has the @Component annotation.
I just cannot figure out what is going wrong. Different parsers and
printrenderers (other than XWIKI_2_0 and XHTML_1_0) as the use of the
Converter instead of Parser produce the same result.
What am i doing wrong? Any help would be really appreciated.
Best regards,
Juri
Output and Stacktrace:
05.09.2009 00:50:35 org.xwiki.component.logging.CommonsLoggingLogger warn
WARNUNG: Component
[org.xwiki.rendering.internal.configuration.DefaultRenderingConfiguration] is being
overwritten by component
[org.xwiki.rendering.internal.configuration.XWikiRenderingConfiguration] for Role/Hint
[role = [org.xwiki.rendering.configuration.RenderingConfiguration] hint = [default]]. It
will not be possible to look it up.
05.09.2009 00:50:35 org.xwiki.component.logging.CommonsLoggingLogger warn
WARNUNG: Component [org.xwiki.rendering.internal.renderer.DefaultLinkLabelGenerator] is
being overwritten by component
[org.xwiki.rendering.internal.renderer.XWikiLinkLabelGenerator] for Role/Hint [role =
[org.xwiki.rendering.renderer.LinkLabelGenerator] hint = [default]]. It will not be
possible to look it up.
05.09.2009 00:50:35 org.xwiki.component.logging.CommonsLoggingLogger warn
WARNUNG: Failed to load configuration file [/WEB-INF/xwiki.properties]. Using default
configuration. Internal error [null]
Exception in thread "main" java.lang.RuntimeException: Failed to create [XHTML
1.0] renderer
at
org.xwiki.rendering.internal.renderer.AbstractPrintRendererFactory.createRenderer(AbstractPrintRendererFactory.java:51)
at de.lernbase.XWikiRenderTest.doit(XWikiRenderTest.java:30)
at de.lernbase.XWikiRenderTest.main(XWikiRenderTest.java:58)
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup
component [role = [org.xwiki.rendering.renderer.PrintRenderer] hint = [xhtml/1.0]]
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:311)
at
org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:109)
at
org.xwiki.component.internal.DefaultComponentManager.lookup(DefaultComponentManager.java:85)
at
org.xwiki.rendering.internal.renderer.AbstractPrintRendererFactory.createRenderer(AbstractPrintRendererFactory.java:49)
... 2 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup
component [role = [org.xwiki.rendering.renderer.xhtml.XHTMLLinkRenderer] hint =
[default]]
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:311)
at
org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:109)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:347)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:328)
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:304)
... 5 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup
component [role = [org.xwiki.rendering.renderer.LinkLabelGenerator] hint = [default]]
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:311)
at
org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:109)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:347)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:328)
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:304)
... 9 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup
component [role = [org.xwiki.rendering.configuration.RenderingConfiguration] hint =
[default]]
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:311)
at
org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:109)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:347)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:328)
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:304)
... 13 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup
component [role = [org.xwiki.configuration.ConfigurationSource] hint = [default]]
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:311)
at
org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:109)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:347)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:328)
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:304)
... 17 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup
component [role = [org.xwiki.configuration.ConfigurationSource] hint = [wiki]]
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:311)
at
org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:109)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:347)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:328)
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:304)
... 21 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup
component [role = [org.xwiki.bridge.DocumentAccessBridge] hint = [default]]
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:311)
at
org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:109)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:347)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:328)
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:304)
... 25 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Can't find descriptor
for the component [role = [org.xwiki.bridge.DocumentAccessBridge] hint = [default]]
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:325)
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:304)
... 29 more