NoClassDefFoundError: Failed to link org/glassfish/jersey/server/ResourceConfig

Viewed 301

Has anyone had success deploying Jersey 2.x with JBoss 7.x? I've tried deploying Jersey 2.X with JBoss 7.2 but encountered errors like:

{"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"WLS_DOM_SPS.ear\".\"wls_dom_sps.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment \"wls_dom_sps.war\" of deployment \"WLS_DOM_SPS.ear\"
    Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class org.glassfish.jersey.servlet.ServletContainer with ClassLoader ModuleClassLoader for Module \"deployment.WLS_DOM_SPS.ear.wls_dom_sps.war\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: Failed to link org/glassfish/jersey/server/ResourceConfig (Module \"deployment.WLS_DOM_SPS.ear.wls_dom_sps.war\" from Service Module Loader): javax/ws/rs/core/Configurable"}}

the dependencies: lib

my web.xml is:

 <context-param>
        <param-name>resteasy.scan</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>resteasy.scan.providers</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>resteasy.scan.resources</param-name>
        <param-value>false</param-value>
    </context-param>
<servlet>
        <servlet-name>JAX-RS Servlet</servlet-name>
        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>jersey.config.server.provider.packages</param-name>
            <param-value>
                com.oocl.csc.frm.soa.rest.provider,
                com.oocl.csc.frm.integration.exception.logger.js,
                com.oocl.frm.art.resource,
                com.oocl.frm.common.date.resource,
                com.oocl.frm.evs.rest.resource,
                com.oocl.frm.eav.restful,
                com.oocl.frm.eav.nativeRestful,
                com.oocl.frm.evs.test.rest.resource,
                com.oocl.fwk.demo.jboss.rest
            </param-value>
        </init-param>
        <init-param>
            <param-name>javax.ws.rs.Application</param-name>
            <param-value>com.oocl.csc.frm.soa.rest.provider.FWServiceResourceConfigProvider</param-value>
        </init-param>
        <init-param>
            <param-name>jersey.config.server.provider.scanning.recursive</param-name>
            <param-value>true</param-value>
        </init-param>
       
    </servlet>

jboss-deployment-structure is:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
  <sub-deployment name="wls_dom_sps.war">
    <dependencies>
        <module name="org.apache.xerces" />
        <module name="org.dom4j" />
        <module name="org.jboss.remote-naming" />

        <module name="com.oocl.sps.aeserver.config"/>
        <module name="com.mysql"/>
      %%OPTIONAL_DEPENDENCY%%
    </dependencies>
      <exclusions>
          <module name="javaee.api" />
          <module name="javax.ws.rs.api"/>
          <module name="org.jboss.resteasy.resteasy-jaxrs" />
      </exclusions>
  </sub-deployment>
</jboss-deployment-structure>

Has anyone had any luck with Jboss and Jersey 2.x? Any help would be appreciated.

Thanks.

0 Answers
Related