XWiki v13 with MySQL v8

Hello-hello,

Could anyone confirm that XWiki v13.1 doesn’t support MySQL v8 ?

I have tried to launch it in different ways via docker compose, but seems it doesn’t work. Everything crushing and I’ve been receiving a lot of root-cause messages.
I’m not sure does any detailed info is needed, but if so --let me know and I’ll provide it.

XWiki definitely works with MySQL 8. You should paste the very first stack trace you have in the log.

Thanks for fast reply.

Type Exception Report

Message Failed to execute the action with name [view]

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Failed to execute the action with name [view]
	com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:106)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
	org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:109)
	org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
	org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
	org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
	org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)

Root Cause

com.xpn.xwiki.XWikiException: Error number 11007 in 0: Failed to extract Entity Resource Reference from URL [http://localhost:8080/bin/view/Main/]
	com.xpn.xwiki.XWiki.initializeResourceFromURL(XWiki.java:1050)
	com.xpn.xwiki.XWiki.getXWiki(XWiki.java:910)
	com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:350)
	com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:258)
	com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:104)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
	org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:109)
	org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
	org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
	org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
	org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)

Root Cause

java.lang.RuntimeException: Failed to locate wiki descriptor for alias [localhost]
	org.xwiki.url.internal.standard.AbstractWikiReferenceExtractor.getWikiDescriptorByAlias(AbstractWikiReferenceExtractor.java:80)
	org.xwiki.url.internal.standard.DomainWikiReferenceExtractor.resolveDomainBasedWikiReference(DomainWikiReferenceExtractor.java:61)
	org.xwiki.url.internal.standard.DomainWikiReferenceExtractor.extract(DomainWikiReferenceExtractor.java:47)
	org.xwiki.url.internal.standard.entity.BinEntityResourceReferenceResolver.extractWikiReference(BinEntityResourceReferenceResolver.java:51)
	org.xwiki.url.internal.standard.entity.AbstractEntityResourceReferenceResolver.resolve(AbstractEntityResourceReferenceResolver.java:87)
	org.xwiki.url.internal.standard.entity.AbstractEntityResourceReferenceResolver.resolve(AbstractEntityResourceReferenceResolver.java:50)
	org.xwiki.url.internal.GenericResourceReferenceResolver.resolve(GenericResourceReferenceResolver.java:61)
	org.xwiki.url.internal.GenericResourceReferenceResolver.resolve(GenericResourceReferenceResolver.java:47)
	org.xwiki.url.internal.standard.StandardExtendedURLResourceReferenceResolver.resolve(StandardExtendedURLResourceReferenceResolver.java:65)
	org.xwiki.url.internal.standard.StandardExtendedURLResourceReferenceResolver.resolve(StandardExtendedURLResourceReferenceResolver.java:43)
	org.xwiki.url.internal.DefaultResourceReferenceResolver.resolve(DefaultResourceReferenceResolver.java:93)
	org.xwiki.url.internal.DefaultResourceReferenceResolver.resolve(DefaultResourceReferenceResolver.java:48)
	com.xpn.xwiki.XWiki.initializeResourceFromURL(XWiki.java:1045)
	com.xpn.xwiki.XWiki.getXWiki(XWiki.java:910)
	com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:350)
	com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:258)
	com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:104)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
	org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:109)
	org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
	org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
	org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
	org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)

I believe you’re missing some parts of the stack trace since it doesn’t seem complete. Could you check?

The error tend to be incomplete in the browser, you should take a look at the log.

Sorry for delay in reply.

Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
............
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.sql.SQLException: Cannot create PoolableConnectionFactory (Public Key Retrieval is not allowed
............
Caused by: java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

Looks like all settings in cfg file is ok. I’ve see the root cause as problem with mysql connector,
but even if I download mysql8 connector and put it to WEB-INF/lib, should I change something in hibernate.cfg?

Maybe you have other ideas.)

Connection Java - MySQL : Public Key Retrieval is not allowed - Stack Overflow seems to be what you are looking for.

Looks like no. I’ve tried it, but still there is Could not create a DBCP pool. There is an error in the Hibernate configuration file, please review it.

I’ve modify MySQL properties as

<property name="connection.url">jdbc:mysql://xwiki-db/xwiki?allowPublicKeyRetrieval=true&amp;useSSL=false</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki</property>
<property name="connection.driver_class">com.mysql.cj.jdbc.Driver</property>
<property name="dbcp.poolPreparedStatements">true</property>
<property name="dbcp.maxOpenPreparedStatements">20</property>

Also I try to change connection.driver_class according to https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationMySQL/ Tips for MySQL 8, but still the same issue:

Caused by: org.hibernate.HibernateException: Could not create a DBCP pool. There is an error in the Hibernate configuration file, please review it.
at com.xpn.xwiki.store.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:242)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:107)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:246)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:145)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
... 39 common frames omitted

Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure

What else may cause the issue?
Also I add nex to my docker-compose:
mysqld --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

This does not really say much, what’s important is the last caused by.