Multiple Instances of XWiki in the Same Container
Last modified by Eleni Cojocariu on 2026/02/17 09:38
Content
Explanation
When running multiple XWiki instances in the same servlet container (e.g., Tomcat or Jetty), you may encounter the following error if multiple instances try to use the same cache domain:
com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context
...
Caused by:
org.infinispan.jmx.JmxDomainConflictException: Domain already registered org.xwiki.infinispanCause
This error occurs because the cache component (Infinispan) attempts to register the same JMX domain for multiple instances, causing a conflict.
Solution
To resolve the issue, you need to configure each XWiki instance to use a unique JMX domain:
- Edit WEB-INF/cache/infinispan/config.xml for each XWiki instance.
- For Infinispan version 7 and above:
- Add the <jmx duplicate-domains="true"/> element inside the <cache-container> element to allow multiple domains.
This ensures that each XWiki instance operates with its own JMX domain, preventing the conflict.