XWiki infinispan InstanceAlreadyExistsException

Hi,

My XWiki Server restarted yesterday and has seemingly updated the JDK to the latest GA version shipped with CentOS9.

Following this, my XWiki server (Tomcat Servlet) will not start and throws a 500 error when trying to access.

I suspected this might be due to an older version of XWiki I was running so I followed the WAR upgrade path and have added the latest stable version.

The error is still the same after this.

In the catalina.out log it seems to all go down too:

Caused by: javax.management.InstanceAlreadyExistsException: org.xwiki.infinispan:type=CacheManager,name="xwiki",component=CacheManager
	at java.management/com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:322)
	at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1848)
	at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:945)
	at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:880)
	at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:315)
	at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:523)
	at org.infinispan.jmx.SecurityActions.lambda$registerMBean$0(SecurityActions.java:35)
	at org.infinispan.jmx.SecurityActions.doPrivileged(SecurityActions.java:26)
	at org.infinispan.jmx.SecurityActions.registerMBean(SecurityActions.java:34)
	at org.infinispan.jmx.AbstractJmxRegistration.register(AbstractJmxRegistration.java:279)
	at org.infinispan.jmx.AbstractJmxRegistration.start(AbstractJmxRegistration.java:88)
	... 94 common frames omitted

I have tried changing the domain within WEB-INF/cache/infinispan/config.xml
I have also tried increasing the cache size to 50k.
But this still gives the same errors.

I have only got a single xwiki folder within the tomcat webapps folder.

I have attached the Catalina.out from today for the latest single full statup sequence.

catalina-21112024.out.log (1.0 MB)

Hopefully someone can help. Thanks!

AFAIU it’s because you already have an xwiki instance running in your servlet container.

That would have indeed been my first question, as this error is usually the sign that two instances of XWiki run in the same JVM.

You might want to check if you have some duplicated JARs (in 2 different versions) in WEB-INF/lib, or in general any leftover JAR of the previous versions you are upgrading from.

I can’t see any duplicate JARs (WAR install was to a clean folder, moved the old xwiki folder within webapps elsewhere so it’s not got multiple)

Output of WEB-INF/lib:

xwiki-WEB-INF-lib-output.txt (85.5 KB)

How would I verify this?

Tomcat manager only shows a single XWiki app running.

Note: The safest would be to move the old xwiki folder outside of webapps, to make sure it’s not picked up as a webapp to deploy by Tomcat.

No idea, if we trust the Tomcat manager, it seems there’s only 1 xwiki deployed.

Make sure you remove the old xwiki folder from webapps. Also make sure to restart Tomcat (in case you were just using a deploy/undeploy without a restart).

Thx

Yes the old XWiki folder has been moved out of webapps.
Tomcat restarted.

Same errors

Maybe try to remove all webapps except the xwiki one. If there’s still an error, then it’s likely that inside the xwiki war, there are two pieces of code registering against the JMX manager (but no idea what that would be as we’re not aware of such an issue).

For reference, some old issue we had in the past: Loading... (maybe something in your instance, like some specific contrib extension or custom code ends up calling the xwiki JMX registration twice).

Moved all of them to a separate folder those now display 404s
XWiki still has the same 500 errors.

As far as I know, I have not added any specific extensions or custom code.
It’s a pretty OOTB installation.

Where would I check for this? I can’t see anything in the logs pointing to specific resources.

You are completely restarting Tomcat, right ? Not just reloading the XWiki application, we are not 100% good at cleaning up when the application is unloaded right now.

Yes I have tried both tomcat restarts and full server restarts.