Error parsing media type 'uritemplate'

I get an exception while deploying xwiki-10.1.war on glassfish 5 jdk1.8.0_144.

[2018-03-07T16:58:53.554+0300] [glassfish 5.0] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=121 _ThreadName=admin-listener(12)] [timeMillis: 1520431133554] [levelValue: 1000] [[
Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: CDI definition failure:Exception List with 1 exceptions:
Exception 0 :
java.lang.IllegalArgumentException: Error parsing media type ‘uritemplate’
at org.glassfish.jersey.message.internal.MediaTypeProvider.fromString(MediaTypeProvider.java:93)
at org.glassfish.jersey.message.internal.MediaTypeProvider.fromString(MediaTypeProvider.java:61)
at javax.ws.rs.core.MediaType.valueOf(MediaType.java:196)

Does anyonw know how to fix it?

Maybe see http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationGlassFish/

You’ll need to configure GF to turn off CDI parsing since XWiki doesn’t use CDI and apparently it’s causing some problems.

Thanks