Hi,

Currently xwiki-webdav is using xwiki-core 1.6-SNAPSHOT and it's working
fine. But when it's changed to 1.7-SNAPSHOT (${pom.version}) I get the
following exception :

<dump>
Caused by: com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not
initialize main XWiki context
Wrapped Exception: Failed to load component [org.xwiki.cache.CacheManager]
for hint [default]
        at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:326)
        at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:387)
        at
com.xpn.xwiki.plugin.webdav.utils.XWikiDavResourceFactory.initXWikiContext(XWikiDavResourceFactory.java:169)
        at
com.xpn.xwiki.plugin.webdav.utils.XWikiDavResourceFactory.createResource(XWikiDavResourceFactory.java:113)
</dump>

The exception is thrown when the XWikiContext is being initialized. The code
looks like bellow :

<code>
private void initXWikiContext(DavServletRequest drequest, DavServletResponse
dresponse,
        ServletContext servletContext) throws XWikiException
    {
        XWikiEngineContext xwikiEngine = new
XWikiServletContext(servletContext);
        XWikiRequest xwikiRequest = new XWikiServletRequest(drequest);
        XWikiResponse xwikiResponse = new XWikiXmlRpcResponse(dresponse);

        xwikiContext = Utils.prepareContext("", xwikiRequest, xwikiResponse,
xwikiEngine);
        xwikiContext.setMode(XWikiContext.MODE_GWT);
        xwikiContext.setDatabase("xwiki");

        ServletContainerInitializer containerInitializer =
            (ServletContainerInitializer)
Utils.getComponent(ServletContainerInitializer.ROLE);
        try {
            containerInitializer.initializeRequest(xwikiContext.getRequest()
                .getHttpServletRequest(), xwikiContext);

containerInitializer.initializeResponse(xwikiContext.getResponse()
                .getHttpServletResponse());
            containerInitializer.initializeSession(xwikiContext.getRequest()
                .getHttpServletRequest());

containerInitializer.initializeApplicationContext(servletContext);
        } catch (ServletContainerException e) {
            throw new XWikiException(XWikiException.MODULE_XWIKI_PLUGINS,
                XWikiException.ERROR_XWIKI_INIT_FAILED,
                "Failed to initialize Request/Response or Session",
                e);
        }

        *XWiki xwiki = XWiki.getXWiki(xwikiContext);* // (This is where the
exception get's thrown)
</code>

Can someone please help me with how to properly initialize the XWikiContext
with 1.7-SNAPSHOT core ?

Thanks.

- Asiri
_______________________________________________
devs mailing list
devs@xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to