Xwiki not starting on ubuntu 20

Hi there,

i try to install xwiki with the .deb package (apt-get install xwiki-tomcat9-common).
After the packages are installed, xwiki takes ~30 minutes to reach 100% of starting and stopps then.
I have already increased the Tomcat memory (JAVA_OPTS=“-Djava.awt.headless=true -Xmx1024m”).

System: Ubuntu Server 20.04.; 2 GB RAM

● tomcat9.service - Apache Tomcat 9 Web Application Server
Loaded: loaded (/lib/systemd/system/tomcat9.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/tomcat9.service.d
└─xwiki-tomcat9-systemd.conf
Active: active (running) since Thu 2020-12-17 10:07:25 CET; 19min ago
Docs: Apache Tomcat 9 (9.0.89) - Documentation Index
Process: 20190 ExecStartPre=/usr/libexec/tomcat9/tomcat-update-policy.sh (code=exited, status=0/SUCCESS)
Main PID: 20205 (java)
Tasks: 208 (limit: 2281)
Memory: 507.5M
CGroup: /system.slice/tomcat9.service
└─20205 /usr/bin/java -Djava.util.logging.config.file=/var/lib/tomcat9/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headle>

Dez 17 10:26:18 xwiki tomcat9[20205]: … 12 common frames omitted
Dez 17 10:26:18 xwiki tomcat9[20205]: Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set
Dez 17 10:26:18 xwiki tomcat9[20205]: at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100)
Dez 17 10:26:18 xwiki tomcat9[20205]: at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54)
Dez 17 10:26:18 xwiki tomcat9[20205]: at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137)
Dez 17 10:26:18 xwiki tomcat9[20205]: at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
Dez 17 10:26:18 xwiki tomcat9[20205]: at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
Dez 17 10:26:18 xwiki tomcat9[20205]: at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
Dez 17 10:26:18 xwiki tomcat9[20205]: … 29 common frames omitted
Dez 17 10:26:18 xwiki tomcat9[20205]: 2020-12-17 10:26:18,062 [XWiki initialization] WARN o.h.c.i.C3P0ConnectionProvider - HHH10001006: No JDBC Driver class was specified by property hib>

This log suggests that the /etc/xwiki/hibernate.cfg.xml file is not used. I’m using the Debian package on Ubuntu 20.04 too and it’s working well.

If you just installed XWiki and never tried to restarted tomcat9 one possibility I noticed in the past is apt/dpkg sometimes not following the declared dependencies order and starting tomcat before the database setup package is installed. In this case a simple restart should fix it.

If it’s not that then there seems to be something in your environment preventing XWiki to load the /etc/xwiki/hibernate.cfg.xml file but hard to say from what you pasted. Maybe you can find a clue in the tomcat9 service log between the tomcat startup and this log. I think with recent version of the tomcat9 package the log now goes in syslog by default so you can access it using journalctl -u tomcat9.service for example.

Hi tmortagne,

thank you for your answer. Your direction to the hibernate.cfg.xml was correct.
For some reason the file was empty. After i reinstalled it and configured the database connection in this file xwiki starts correctly.