XWiki 10.7 war - failure to deploy on Wildfly 14.0

Hello everyone,

I’m trying to move my Xwiki, which I have been using for a few months, from an old laptop to a newer laptop. I am using Wildfly for another Project and trying to install Xwiki in the same platform: Windows 10, Postgresql 10, Wildfly 14.

I have “exploded” the Xwiki war file and made my changes in the configuration files, but when I try to ENABLE the deployment, it fails with the following messages:

2018-09-03 20:24:57,421 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "xwiki-platform-distribution-war-10.7.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"xwiki-platform-distribution-war-10.7.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"xwiki-platform-distribution-war-10.7.war\"
    Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.codahale.metrics.jetty9.InstrumentedHandler$7 with ClassLoader ModuleClassLoader for Module \"deployment.xwiki-platform-distribution-war-10.7.war\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: Failed to link com/codahale/metrics/jetty9/InstrumentedHandler (Module \"deployment.xwiki-platform-distribution-war-10.7.war\" from Service Module Loader): org/eclipse/jetty/server/handler/HandlerWrapper"}}
2018-09-03 20:24:57,437 ERROR [org.jboss.as.server] (External Management Request Threads -- 1) WFLYSRV0021: Deploy of deployment "xwiki-platform-distribution-war-10.7.war" was rolled back with the following failure message: 
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"xwiki-platform-distribution-war-10.7.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"xwiki-platform-distribution-war-10.7.war\"
    Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.codahale.metrics.jetty9.InstrumentedHandler$7 with ClassLoader ModuleClassLoader for Module \"deployment.xwiki-platform-distribution-war-10.7.war\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: Failed to link com/codahale/metrics/jetty9/InstrumentedHandler (Module \"deployment.xwiki-platform-distribution-war-10.7.war\" from Service Module Loader): org/eclipse/jetty/server/handler/HandlerWrapper"}}
2018-09-03 20:25:02,203 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0028: Stopped deployment xwiki-platform-distribution-war-10.7.war (runtime-name: xwiki-platform-distribution-war-10.7.war) in 4750ms

I have searched the internet and it seems that the most probable cause is an old version of the codahale.metrics jar libraries, perhaps not java 8. Could that be the case? Could those be removed or replaced with newer versions?

Any guidance or suggestion will be appreciated.

Thanks,

Ismael

I see indeed that we bundle WEB-INF/lib/metrics-jetty9-3.1.2.jar in XWiki’s WAR. This is coming from some 3rd-party dependency (I haven’t checked from which one yet). And it seems to have a runtime dep on org/eclipse/jetty/server/handler/HandlerWrapper which ofc isn’t found since you’re not on Jetty but on WildFly.

So I’d say this is a bug in XWiki’s packaging. Would you mind creating a jira issue in https://jira.xwiki.org/projects/XWIKI/summary and I’ll look into it? Thx

I’ve now created https://jira.xwiki.org/browse/XWIKI-15565

See https://jira.xwiki.org/browse/XWIKI-15565?focusedCommentId=99655&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-99655 for a workaround for you.