Wildfly 10.0 - java.lang.NoClassDefFoundError: Failed to link org/jboss/resteasy/skeleton/key/as7/OAuthAuthenticationServerValve
<p>I have problem http-handler: org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve in Wildfly 10.0</p>

<p>I setup simple authentication application wiht form-based authentication to test/init implementation of oauth 2.0.</p>

<p>For some reason, I keep getting NoClassDefFoundError while deploying my app, despite, module with skeleton-key is installed.</p>

<p>Here's error from wildlfy server.log:</p>

<pre><code>    18:08:11,049 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "im-oauth-auth-1.0.war" (runtime-name: "im-oauth-auth-1.0.war")
18:08:11,447 WARN  [org.jboss.modules] (MSC service thread 1-8) Failed to define class org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve in Module "org.jboss.resteasy.skeleton-key:main" from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: /media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules,/media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules/system/layers/base)): java.lang.NoClassDefFoundError: Failed to link org/jboss/resteasy/skeleton/key/as7/OAuthAuthenticationServerValve (Module "org.jboss.resteasy.skeleton-key:main" from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: /media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules,/media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules/system/layers/base))): org/apache/catalina/LifecycleListener
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
    at org.jboss.modules.Module.loadModuleClass(Module.java:605)
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
    at org.wildfly.extension.undertow.deployment.UndertowHandlersDeploymentProcessor.handleJbossWebXml(UndertowHandlersDeploymentProcessor.java:94)
    at org.wildfly.extension.undertow.deployment.UndertowHandlersDeploymentProcessor.deploy(UndertowHandlersDeploymentProcessor.java:70)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

18:08:11,449 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."im-oauth-auth-1.0.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."im-oauth-auth-1.0.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "im-oauth-auth-1.0.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: Failed to link org/jboss/resteasy/skeleton/key/as7/OAuthAuthenticationServerValve (Module "org.jboss.resteasy.skeleton-key:main" from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: /media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules,/media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules/system/layers/base))): org/apache/catalina/LifecycleListener
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
    at org.jboss.modules.Module.loadModuleClass(Module.java:605)
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
    at org.wildfly.extension.undertow.deployment.UndertowHandlersDeploymentProcessor.handleJbossWebXml(UndertowHandlersDeploymentProcessor.java:94)
    at org.wildfly.extension.undertow.deployment.UndertowHandlersDeploymentProcessor.deploy(UndertowHandlersDeploymentProcessor.java:70)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
    ... 5 more

18:08:11,450 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 6) WFLYCTL0013: Operation ("deploy") failed - address: ({"deployment" =&gt; "im-oauth-auth-1.0.war"}) - failure description: {"WFLYCTL0080: Failed services" =&gt; {"jboss.deployment.unit.\"im-oauth-auth-1.0.war\".POST_MODULE" =&gt; "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"im-oauth-auth-1.0.war\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"im-oauth-auth-1.0.war\"
    Caused by: java.lang.NoClassDefFoundError: Failed to link org/jboss/resteasy/skeleton/key/as7/OAuthAuthenticationServerValve (Module \"org.jboss.resteasy.skeleton-key:main\" from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: /media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules,/media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules/system/layers/base))): org/apache/catalina/LifecycleListener"}}
18:08:11,451 ERROR [org.jboss.as.server] (management-handler-thread - 6) WFLYSRV0021: Deploy of deployment "im-oauth-auth-1.0.war" was rolled back with the following failure message: 
{"WFLYCTL0080: Failed services" =&gt; {"jboss.deployment.unit.\"im-oauth-auth-1.0.war\".POST_MODULE" =&gt; "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"im-oauth-auth-1.0.war\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"im-oauth-auth-1.0.war\"
    Caused by: java.lang.NoClassDefFoundError: Failed to link org/jboss/resteasy/skeleton/key/as7/OAuthAuthenticationServerValve (Module \"org.jboss.resteasy.skeleton-key:main\" from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: /media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules,/media/data/im_jboss/wildfly/wildfly-10.0.0.Final/modules/system/layers/base))): org/apache/catalina/LifecycleListener"}}
18:08:11,459 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0028: Stopped deployment im-oauth-auth-1.0.war
</code></pre>

<p>here's my jboss-web.xml content:</p>

<pre><code>&lt;jboss-web&gt;
  &lt;security-domain&gt;java:/jaas/commerce&lt;/security-domain&gt;
  &lt;http-handler&gt;
    &lt;class-name&gt;org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve&lt;/class-name&gt;
    &lt;module&gt;org.jboss.resteasy.skeleton-key&lt;/module&gt;
  &lt;/http-handler&gt;
&lt;/jboss-web&gt;
</code></pre>

<p>here's jboss-deployment-structure.xml</p>

<pre><code>&lt;deployment&gt;
  &lt;dependencies&gt;
    &lt;!--
                &lt;module name="org.jboss.resteasy.resteasy-jaxrs" services="import"/&gt;
                &lt;module name="org.jboss.resteasy.resteasy-jackson-provider" services="import"/&gt;  --&gt;
    &lt;module name="org.jboss.resteasy.skeleton-key"/&gt;
  &lt;/dependencies&gt;
&lt;/deployment&gt;
</code></pre>

<p>Here's content of {wildfly-10.0.0.Final}/modules/system/layers/base/org/jboss/resteasy/</p>

<pre><code>drwxr-xr-x 44 ordo ordo 4096 sty 29 23:12 ../
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 jose-jwt/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-atom-provider/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-cdi/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-crypto/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-jackson2-provider/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-jackson-provider/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-jaxb-provider/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-jaxrs/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-jettison-provider/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-jsapi/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-json-p-provider/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-multipart-provider/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-spring/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-validator-provider-11/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 resteasy-yaml-provider/
drwxr-xr-x  3 ordo ordo 4096 maj  8 17:44 skeleton-key/
</code></pre>

<ul>
<li>I copy paste and unzip skeleton-key module from downloaded Resteasy project: resteasy-jboss-modules-wf8-3.0.16.Final.zip</li>
</ul>

<p>Any help would be super!
Thanks in advance!</p>

<p>edit:</p>

<p>as requested, I'm adding content of skeleton-key dir:</p>

<pre><code>wildfly-10.0.0.Final/modules/system/layers/base/org/jboss/resteasy/skeleton-key/main$ ll
total 120
drwxr-xr-x 2 ordo ordo  4096 maj 11 09:59 ./
drwxr-xr-x 3 ordo ordo  4096 maj 11 09:59 ../
-rw-r--r-- 1 ordo ordo  2323 maj 11 09:59 module.xml
-rw-r--r-- 1 ordo ordo 53934 maj 11 09:59 skeleton-key-as7-3.0.16.Final.jar
-rw-r--r-- 1 ordo ordo 52383 maj 11 09:59 skeleton-key-core-3.0.16.Final.jar
</code></pre>

<p>And content of module.xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2010, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  --&gt;

&lt;module xmlns="urn:jboss:module:1.1" name="org.jboss.resteasy.skeleton-key"&gt;
    &lt;resources&gt;
        &lt;resource-root path="skeleton-key-as7-3.0.16.Final.jar"/&gt;
        &lt;resource-root path="skeleton-key-core-3.0.16.Final.jar"/&gt;
        &lt;!-- Insert resources here --&gt;
    &lt;/resources&gt;

    &lt;dependencies&gt;
        &lt;module name="javax.api"/&gt;
        &lt;module name="javax.servlet.api"/&gt;
        &lt;module name="javax.security.auth.message.api"/&gt;
        &lt;module name="javax.security.jacc.api"/&gt;
        &lt;module name="org.jboss.as.web"/&gt;
        &lt;module name="javax.ws.rs.api"/&gt;
        &lt;module name="org.picketbox"/&gt;
        &lt;module name="org.codehaus.jackson.jackson-core-asl"/&gt;
        &lt;module name="org.codehaus.jackson.jackson-jaxrs"/&gt;
        &lt;module name="org.codehaus.jackson.jackson-mapper-asl"/&gt;
        &lt;module name="org.codehaus.jackson.jackson-xc"/&gt;
        &lt;module name="org.jboss.resteasy.resteasy-jackson-provider" services="import"/&gt;
        &lt;module name="org.jboss.resteasy.resteasy-jaxrs" services="import"/&gt;
        &lt;module name="org.jboss.logging"/&gt;
        &lt;module name="org.jboss.resteasy.jose-jwt"/&gt;
        &lt;module name="org.bouncycastle"/&gt;
    &lt;/dependencies&gt;
&lt;/module&gt;
</code></pre>