RESTEasy module/classes are being used in my JAX-RS application even after excluding RESTEasy from the deployment in JBoss EAP 6

Solution Verified - Updated -

Issue

  • I'd like to use Jersey as my application's JAX-RS implementation. To accomplish this task, I have followed the directions from this knowledgebase solution.

We also have another deployment that is choosing to use RESTEasy. Before the RESTEasy application has been invoked for the first time, the Jersey application works as expected, but after the first invocation of the RESTEasy application, Jersey tries to use the UriBuilderImpl class from RESTEasy instead of jersey-bundle-1.2.jar.

Below is the exception that I am running into that exposes that RESTEasy classes are being used:

java.lang.IllegalArgumentException: You did not supply enough values to fill path parameters
    org.jboss.resteasy.specimpl.UriBuilderImpl.buildFromValues(UriBuilderImpl.java:546)
    org.jboss.resteasy.specimpl.UriBuilderImpl.build(UriBuilderImpl.java:539)
    com.redhat.gss.jaxrs.SomeFilter.filter(AccessStatisticFilter.java:108)
    com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:258)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133)
    com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:83)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133)
    com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:71)
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:996)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:947)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:938)
    com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:399)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:478)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:663)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
  • We are trying to use CXF as our JAX-RS implementation, but we are facing ClassCastException when running our application:
java.lang.ClassCastException: org.jboss.resteasy.core.ServerResponse cannot be cast to org.apache.cxf.jaxrs.impl.ResponseImpl

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In