Failure to start - Xwiki 10.11.1 with datasource in Wildfly 14.x

Hi XWiki Team / Community,

I’m trying to deploy a Xwiki 10.11.1 instance on a fresh Wildfly 14.0.1 using a pre-configured PostgreSQL datasource on the container, but it seems I’m really missing some point. After trying all the information/configuration I could find (including some xwiki old forum entries), still not working. I’d really appreciate your help.

1) The failure: It seems my xwiki instance is not finding/binding to the datasource specified in hibernate.cfg.xml and web.xml files (and even a jboss-web.xml I’ve tried). On the first xwiki start, instead of the installation wizard, I’m getting an obviously very long stack trace about the missing xwiki reference, with the root cause:

Caused by: org.hibernate.HibernateException: Could not create a DBCP pool. There is an error in the Hibernate configuration file, please review it.
Caused by: java.lang.NullPointerException
at java.util.Hashtable.put(
... 110 more

2) My configs: I’ve defined the following datasource (and also the associated postgresql jdbc driver, with latest jar available) in Wildfly, and I can test it with success from container admin UI (changed the particular username/pass etc:

<datasource jndi-name="java:jboss/datasources/wikiPortalDS" pool-name="wikiPortalDS">
                <connection-property name="url">
                    <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
                    <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>

I’ve also set this datasource as the default binding datasource on wildfly, in server EE params.

I can see it successfully binds upon server start:

INFO  [] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:jboss/datasources/wikiPortalDS]

So far I’ve used these configs, after many tries following infos from the war install guide and the Jboss/Wildfly internet forums:


<description>wiki Portal DataSource</description>

WEB-INF/hibernate.cfg.xml (only the PostgreSQL related lines):

<property name="connection.datasource">jdbc/wikiPortalDataSource</property>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="xwiki.virtual_mode">schema</property>
<property name="jdbc.use_streams_for_binary">false</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.postgresql.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>

WEB-INF/jboss-web.xml (added this file, since it’s a container specific configuration and it seems to be needed to map xwiki DS to the container-defined DS (OR NOT? :face_with_raised_eyebrow:)):

<jboss-web xmlns=""

3) The questions:

  • Is anything wrong with the config?
  • How can I properly map wildfly’s defined datasource to my xwiki instance? jboss-web.xml is needed in this case? Should I use any special namespaces/naming/reference etc?
  • Shouldn’t/Can’t I use the JNDI container datasource name directly on hibernate.cfg.xml? (tried that, no success)

Xwiki install guides seems not to be clear enough in datasource configs for wildfly. I would be more than welcome to help completing this info there.

Thanks in advance,
Ramon Brandao

Disclaimer: I’m not a Wildfly user nor a data source one :wink:

I’ve checked the sources and this means that the hibernate.connection.driver_class property is not defined in your hibernate.cfg.xml file.

The doc at seems to suggest something like:

<property name="connection.datasource">java:jboss/datasources/XWikiDS</property>