Install xwiki 17.2 from WAR on tomcat

Hi xwiki forum

I want to install xwiki 17.2 from WAR on tomcat 10.1.5 with use mariadb on my server (Rocky Linux 9)

So I’ve copy mariadb-java-client-3.5.3.jar to WEB-INF/lib/ and modify hibernate.cfg.xml file as is :

<property name="hibernate.connection.url">jdbc:mariadb://localhost/xwiki?useSSL=false</property>
<property name="hibernate.connection.username">xwiki</property>
<property name="hibernate.connection.password">xwiki</property>
<property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</property>
<property name="hibernate.dbcp.poolPreparedStatements">true</property>
<property name="hibernate.dbcp.maxOpenPreparedStatements">20</property>

<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>

<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>

xwiki start to 50% an I have some errors :

jakarta.servlet.ServletException: Failed to execute the action with name [view]
(…)
com.xpn.xwiki.XWikiException: Error number 11007 in 0: Failed to extract Entity Resource Reference from URL [http://localhost:8080/xwiki/bin/view/Main/]
(…)
java.lang.RuntimeException: Failed to locate wiki descriptor for alias [localhost]
(…)
org.xwiki.wiki.manager.WikiManagerException: Failed to locate XWiki.XWikiServerClass document for wiki alias [localhost]
(…)
org.xwiki.query.QueryException: Exception while translating [where doc.object(XWiki.XWikiServerClass).server = :wikiAlias and doc.name like ‘XWikiServer%’] XWQL query to the [hql] language. Query statement = [where doc.object(XWiki.XWikiServerClass).server = :wikiAlias and doc.name like ‘XWikiServer%’]
(…)
com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [xwiki:XWiki.XWikiServerClass()]
(…)
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
(…)
org.hibernate.HibernateException: Could not create a DBCP pool. There is an error in the Hibernate configuration file, please review it.
(…)
java.sql.SQLException: Cannot load JDBC driver class ‘org.mariadb.jdbc.Driver’
(…)
java.lang.ClassNotFoundException: org.mariadb.jdbc.Driver

Is someone can help me ?

Bye

This seems to indicate that either <property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</property> is wrong or the MariaDB JDBC driver jar is not in WEB-IBF/lib.

And org.mariadb.jdbc.Driver seems ok according to https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationMariaDB/

If you really have a jar in web-inf/lib, do a jar -tvf on it to verify that the org.mariadb.jdbc.Driver class is in there.

Hi vmassol

It’s seem to be org.mariadb.jdbc.Driver class name, but I have always same errors

The error suggests that it’s not found. Maybe check if the user who run the application server you are using is allowed to read that file.

mariadb-java-client-3.5.3.jar is readable for all users

ok. I had change right for mariadb-java-client-3.5.3.jat to tomcat user. So next error was mariadb wrong password. changed password and set rights in mariadb for user to xwiki database. all is ok, and xwiki start. Thank-you for helping !