Juri Kühn wrote:
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.
Vincent, look at the dependency chain:
[role = [org.xwiki.rendering.renderer.PrintRenderer]
hint = [xhtml/1.0]]
[role = [org.xwiki.rendering.renderer.xhtml.XHTMLLinkRenderer] hint = [default]]
[role = [org.xwiki.rendering.renderer.LinkLabelGenerator] hint = [default]]
[role = [org.xwiki.rendering.configuration.RenderingConfiguration] hint = [default]]
[role = [org.xwiki.configuration.ConfigurationSource] hint = [default]]
[role = [org.xwiki.configuration.ConfigurationSource] hint = [wiki]]
[role = [org.xwiki.bridge.DocumentAccessBridge] hint = [default]]
--
Sergiu Dumitriu
http://purl.org/net/sergiu/