com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context Wrapped Exception: null

XWiki.org JIRA | Fabio Mancinelli | 8 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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)

    XWiki.org JIRA | 8 years ago | Fabio Mancinelli
    com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context Wrapped Exception: null

    Root Cause Analysis

    1. com.xpn.xwiki.XWikiException

      Error number 3 in 0: Could not initialize main XWiki context Wrapped Exception: null

      at com.xpn.xwiki.XWiki.getMainXWiki()
    2. com.xpn.xwiki
      XWikiReflectiveXmlRpcHandler.execute
      1. com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:326)
      2. com.xpn.xwiki.XWiki.getXWiki(XWiki.java:387)
      3. com.xpn.xwiki.xmlrpc.XWikiReflectiveXmlRpcHandler.execute(XWikiReflectiveXmlRpcHandler.java:85)
      3 frames
    3. Apache XML-RPC Server Library
      XmlRpcServlet.doPost
      1. org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:43)
      2. org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:83)
      3. org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:182)
      4. org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:103)
      5. org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:120)
      5 frames
    4. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      2 frames
    5. Jetty Server
      WebApplicationHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
      2. org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
      2 frames
    6. com.xpn.xwiki
      DavFilter.doFilter
      1. com.xpn.xwiki.plugin.webdav.DavFilter.doFilter(DavFilter.java:68)
      1 frame
    7. Jetty Server
      WebApplicationHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      1 frame
    8. com.xpn.xwiki
      ConversionFilter.doFilter
      1. com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:96)
      1 frame
    9. Jetty Server
      WebApplicationHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      1 frame
    10. com.xpn.xwiki
      SavedRequestRestorerFilter.doFilter
      1. com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:287)
      1 frame
    11. Jetty Server
      WebApplicationHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      1 frame
    12. com.xpn.xwiki
      SetCharacterEncodingFilter.doFilter
      1. com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      1 frame
    13. Jetty Server
      ServletHandler.handle
      1. org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      2. org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
      3. org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
      3 frames
    14. org.mortbay.http
      HttpContext.handle
      1. org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
      1 frame
    15. Jetty Server
      WebApplicationContext.handle
      1. org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
      1 frame
    16. org.mortbay.http
      SocketListener.handleConnection
      1. org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
      2. org.mortbay.http.HttpServer.service(HttpServer.java:954)
      3. org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
      4. org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
      5. org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
      6. org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
      6 frames
    17. Jetty Util
      ThreadPool$PoolThread.run
      1. org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      2. org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
      2 frames