Hi Artem,
On Mon, Jul 21, 2008 at 2:56 AM, Artem Melentyev <amelentev(a)gmail.com>
wrote:
Hi, Asiri.
The problem is Execution object is not completely initialized so it has
no ExecutionContext.
AFAIK, Execution need to be initialized explicitly by
ServletContainerInitializer or else.
Look at XWikiAction#initializeContainerComponent
So you need something similar before call XWiki.getXWiki(xwikiContext);
I did as you said and the situation has improved. But i'm getting the
following exception now,
<dump>
com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while
reading document XWiki.XWikiPreferences
Wrapped Exception: Can't find [/WEB-INF/hibernate.cfg.xml] for hibernate
configuration
at
com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:742)
at
com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:204)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1315)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1355)
at com.xpn.xwiki.XWiki.getPrefsClass(XWiki.java:2732)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:730)
at com.xpn.xwiki.XWiki.<init>(XWiki.java:650)
at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:310)
at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:381)
at
com.xpn.xwiki.plugin.webdav.utils.XWikiDavParams.initXWikiContext(XWikiDavParams.java:119)
at
com.xpn.xwiki.plugin.webdav.utils.XWikiDavParams.<init>(XWikiDavParams.java:65)
at
com.xpn.xwiki.plugin.webdav.utils.XWikiResourceFactory.createResource(XWikiResourceFactory.java:97)
at
com.xpn.xwiki.plugin.webdav.utils.XWikiResourceFactory.createResource(XWikiResourceFactory.java:66)
at
com.xpn.xwiki.plugin.webdav.XWikiDavServlet.service(XWikiDavServlet.java:357)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:219)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:738)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:325)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:873)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:391)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
</dump>
Hibernate configuration is there. I believe this is something with my
servlet configuration,
I have following two files:
*[/WEB-INF/web.xml]*
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>
xwiki-webdav-servlet
</display-name>
<servlet>
<description>
</description>
<display-name>
DAVServlet
</display-name>
<servlet-name>
DAVServlet
</servlet-name>
<servlet-class>
com.xpn.xwiki.plugin.webdav.XWikiDavServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DAVServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
*[/WEB-INF/hibernate.cfg.xml]
*
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate
Configuration DTD//EN"
"
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="dbcp.defaultAutoCommit">false</property>
<property name="dbcp.maxActive">50</property>
<property name="dbcp.maxIdle">5</property>
<property name="dbcp.maxWait">30000</property>
<property name="dbcp.whenExhaustedAction">1</property>
<property name="dbcp.ps.whenExhaustedAction">1</property>
<property name="dbcp.ps.maxActive">20</property>
<property name="dbcp.ps.maxWait">120000</property>
<property name="dbcp.ps.maxIdle">20</property>
<property
name="connection.url">jdbc:hsqldb:file:database/xwiki_db;shutdown=true</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<property
name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property
name="dialect">org.hibernate.dialect.HSQLDialect</property>
<property
name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
<property name="connection.pool_size">2</property>
<property name="statement_cache.size">2</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Those are the only two files i have inside /WEB-INF directory. What am i
missing ? Can you help me ?
Thanks a lot :)
- Asiri