Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-2899

Could not initialize main XWiki context in com.xpn.xwiki.xmlrpc.XWikiReflectiveXmlRpcHandler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.7
    • 1.6.1, 1.7 RC1
    • {Unused} Web Services
    • None
    • patch

    Description

      When making an XMLRPC call after that XWiki has just started, an exception is raised in com.xpn.xwiki.xmlrpc.XWikiReflectiveXmlRpcHandler due to a problem with main XWiki context initialization. Everything works fine if XMLRPC calls are done after having accessed XWiki through HTTP (e.g., by opening a browser and loading the main page).

      Here it is the complete stack trace of the exception:

      java.lang.NullPointerException
      at org.xwiki.context.DefaultExecution.getContext(DefaultExecution.java:50)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.initialize(XWikiHibernateBaseStore.java:96)
      at org.xwiki.plexus.lifecycle.phase.InitializePhase.execute(InitializePhase.java:44)
      at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:128)
      at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:142)
      at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:132)
      at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:90)
      at org.codehaus.plexus.DefaultComponentLookupManager.lookup(DefaultComponentLookupManager.java:147)
      at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:277)
      at org.xwiki.plexus.manager.PlexusComponentManager.lookup(PlexusComponentManager.java:76)
      at com.xpn.xwiki.web.Utils.getComponent(Utils.java:545)
      at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:675)
      at com.xpn.xwiki.XWiki.<init>(XWiki.java:656)
      at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:316)
      at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:387)
      at com.xpn.xwiki.xmlrpc.XWikiReflectiveXmlRpcHandler.execute(XWikiReflectiveXmlRpcHandler.java:85)
      at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:43)
      at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:83)
      at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:182)
      at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:103)
      at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:120)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
      at com.xpn.xwiki.plugin.webdav.DavFilter.doFilter(DavFilter.java:68)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:96)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:287)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
      at org.mortbay.http.HttpServer.service(HttpServer.java:954)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
      2008-11-27 20:31:02,978 http://localhost:8080/xwiki/xmlrpc/confluence [P1-19] ERROR server.XmlRpcStreamServer - execute: Error while performing request
      org.apache.xmlrpc.XmlRpcException: Error number 3 in 0: Could not initialize main XWiki context
      Wrapped Exception: null
      at com.xpn.xwiki.xmlrpc.XWikiReflectiveXmlRpcHandler.execute(XWikiReflectiveXmlRpcHandler.java:100)
      at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:43)
      at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:83)
      at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:182)
      at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:103)
      at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:120)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
      at com.xpn.xwiki.plugin.webdav.DavFilter.doFilter(DavFilter.java:68)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:96)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:287)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
      at org.mortbay.http.HttpServer.service(HttpServer.java:954)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
      Caused by:
      com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context
      Wrapped Exception: null
      at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:326)
      at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:387)
      at com.xpn.xwiki.xmlrpc.XWikiReflectiveXmlRpcHandler.execute(XWikiReflectiveXmlRpcHandler.java:85)
      at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:43)
      at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:83)
      at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:182)
      at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:103)
      at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:120)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
      at com.xpn.xwiki.plugin.webdav.DavFilter.doFilter(DavFilter.java:68)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:96)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:287)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
      at org.mortbay.http.HttpServer.service(HttpServer.java:954)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

      Wrapped Exception:

      java.lang.NullPointerException
      at org.xwiki.context.DefaultExecution.getContext(DefaultExecution.java:50)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.initialize(XWikiHibernateBaseStore.java:96)
      at org.xwiki.plexus.lifecycle.phase.InitializePhase.execute(InitializePhase.java:44)
      at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:128)
      at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:142)
      at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:132)
      at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:90)
      at org.codehaus.plexus.DefaultComponentLookupManager.lookup(DefaultComponentLookupManager.java:147)
      at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:277)
      at org.xwiki.plexus.manager.PlexusComponentManager.lookup(PlexusComponentManager.java:76)
      at com.xpn.xwiki.web.Utils.getComponent(Utils.java:545)
      at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:675)
      at com.xpn.xwiki.XWiki.<init>(XWiki.java:656)
      at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:316)
      at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:387)
      at com.xpn.xwiki.xmlrpc.XWikiReflectiveXmlRpcHandler.execute(XWikiReflectiveXmlRpcHandler.java:85)
      at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:43)
      at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:83)
      at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:182)
      at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:103)
      at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:120)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
      at com.xpn.xwiki.plugin.webdav.DavFilter.doFilter(DavFilter.java:68)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:96)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:287)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
      at org.mortbay.http.HttpServer.service(HttpServer.java:954)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

      Attachments

        Issue Links

          Activity

            People

              sdumitriu Sergiu Dumitriu
              fmancinelli Fabio Mancinelli
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: