Multiple Instances of XWiki in the Same Container

Last modified by Eleni Cojocariu-testing account on 2026/08/21 17:09

Explanation

When several XWiki instances are deployed in the same servlet container, such as Tomcat or Jetty, only the first one starts. The others fail while initializing their cache:

com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context
Wrapped Exception: Failed to get cache factory component
...
Caused by:
org.infinispan.jmx.JmxDomainConflictException: Domain already registered org.xwiki.infinispan

Cause

XWiki exposes its caches over JMX, and the domain they register under is set in the cache configuration file shipped inside the web application. Every instance deployed from the same distribution therefore asks for the same domain, and the JMX server refuses the second registration.

Solution

Give each instance a JMX domain of its own:

  1. Open WEB-INF/cache/infinispan/config.xml in one of the instances, and find the jmx element inside cache-container:
    <jmx enabled="true" domain="org.xwiki.infinispan" />
  2. Change its domain attribute to a value unique to that instance:
    <jmx enabled="true" domain="org.xwiki.infinispan.intranet" />
  3. Repeat on every other instance in the container, then restart the container.

On an instance whose caches do not need to be monitored over JMX, setting enabled to false on the same element avoids the conflict as well.

Related

Get Connected