title: java.lang.NoSuchMethodError: javax.ws.rs.core.Response.readEntity
body: <p><strong>What i am doing</strong></p>
  
  <p>Previosly i am using Jercey Client but Jercey don't have mechanism called <em>Retry</em> I have to use RestEasy client so i have added below dependency in my pom.xml file </p>
  
  <pre><code>        &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
              &lt;version&gt;3.0.8.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- JAXB support --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-jaxb-provider&lt;/artifactId&gt;
              &lt;version&gt;3.0.8.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;jaxrs-api&lt;/artifactId&gt;
              &lt;version&gt;3.0.8.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-client&lt;/artifactId&gt;
              &lt;version&gt;3.0.8.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-atom-provider&lt;/artifactId&gt;
              &lt;version&gt;3.0.8.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-multipart-provider&lt;/artifactId&gt;
              &lt;version&gt;3.0.8.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-links&lt;/artifactId&gt;
              &lt;version&gt;3.0.8.Final&lt;/version&gt;
          &lt;/dependency&gt;
           &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-jackson2-provider&lt;/artifactId&gt;
               &lt;version&gt;3.0.8.Final&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>Java code I have written</p>
  
  <pre><code> ResteasyClient client;
     client = new ResteasyClientBuilder().build();
     ResteasyWebTarget target = client.target(usersRequest.getUrl());
     Response  response = null;
     if(null != usersRequest.getXmlObject()){
     response =  target.request().accept(MediaType.APPLICATION_XML_TYPE).post(Entity.entity(usersRequest.getXmlObject(),MediaType.TEXT_XML));
  
     }else{
     response =  target.request().accept(MediaType.APPLICATION_XML_TYPE).get();
             }
     output = response.readEntity(String.class);
  </code></pre>
  
  <p>But I am ending with below error </p>
  
  <blockquote>
    <p>java.lang.NoSuchMethodError:
    javax.ws.rs.core.Response.readEntity(Ljava/lang/Class;)Ljava/lang/Object;
      at
    com.alu.ipprd.mdf.soa.portal.integration.restapi.RestAPIUsersFacade.getAuthorizationUserRole(RestAPIUsersFacade.java:212)
    [mdf-portal-integration-0.0.1-SNAPSHOT.jar:]  at
    com.alu.ipprd.bsm.soa.portal.business.aaa.UsersWorkOrder.processBusinessLogic(UsersWorkOrder.java:57)
    [mdf-portal-business-0.0.1-SNAPSHOT.jar:]     at
    com.alu.ipprd.bsm.soa.portal.business.aaa.UsersWorkOrder.processBusinessLogic(UsersWorkOrder.java:1)
    [mdf-portal-business-0.0.1-SNAPSHOT.jar:]     at
    com.alu.ipprd.bsm.soa.portal.common.business.BaseWorkOrder.submitWorkOrder(BaseWorkOrder.java:75)
    [mdf-portal-common-0.0.1-SNAPSHOT.jar:]   at
    com.alu.ipprd.bsm.soa.portal.bean.LoginBean.doLogin(LoginBean.java:907)
    [classes:]    at
    com.alu.ipprd.bsm.soa.portal.bean.LoginBean.verifyLogged(LoginBean.java:1150)
    [classes:]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method) [rt.jar:1.7.0_79]     at
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [rt.jar:1.7.0_79]     at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [rt.jar:1.7.0_79]     at java.lang.reflect.Method.invoke(Unknown Source)
    [rt.jar:1.7.0_79]     at
    org.apache.el.parser.AstValue.invoke(AstValue.java:262)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
    [jbossweb-7.0.10.Final.jar:]  at
    com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
    [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]    at
    com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:128)
    [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]    at
    javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2464)
    [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]  at
    javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
    [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]  at
    com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2168)
    [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]    at
    com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2116)
    [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]    at
    com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:288)
    [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]    at
    com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:246)
    [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]    at
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
    [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]    at
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]    at
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]    at
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]  at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
    [jbossweb-7.0.10.Final.jar:]  at
    org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154)
    [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
    [jbossweb-7.0.10.Final.jar:]  at
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
    [jbossweb-7.0.10.Final.jar:]  at java.lang.Thread.run(Unknown Source)
    [rt.jar:1.7.0_79]</p>
  </blockquote>
  
  <p>I also checked the jar  <code>jaxrs-api-3.0.8.Final.jar</code> which contain this class and method also in present even then its not going to resolve. Can any one tell me what i am doing wrong?</p>
  
  <p><strong>EDIT 1:-</strong>
  I restrict Jboss to use resteasy jar by adding following entry in <code>jboss-deployment-structure.xml</code></p>
  
  <pre><code>&lt;jboss-deployment-structure&gt;
      &lt;deployment&gt;
  
          &lt;exclusions&gt;
              &lt;module name="org.apache.log4j" /&gt;
              &lt;module name="org.jboss.resteasy.resteasy-atom-provider" /&gt;
              &lt;module name="org.jboss.resteasy.resteasy-cdi" /&gt;
              &lt;module name="org.jboss.resteasy.resteasy-jaxb-provider" /&gt;
              &lt;module name="org.jboss.resteasy.resteasy-jaxrs" /&gt;
              &lt;module name="org.jboss.resteasy.resteasy-jettison-provider" /&gt;
              &lt;module name="org.jboss.resteasy.resteasy-jsapi" /&gt;
              &lt;module name="org.jboss.resteasy.resteasy-multipart-provider" /&gt;
              &lt;module name="org.jboss.resteasy.resteasy-yaml-provider" /&gt;
              &lt;module name="org.jboss.resteasy.resteasy-jackson-provider" /&gt;
              &lt;module name="org.javassist" /&gt;
          &lt;/exclusions&gt;
          &lt;dependencies&gt;
              &lt;module name="javaee.api"&gt;
                  &lt;imports&gt;
                      &lt;exclude path="org/apache/xml/security/**" /&gt;
                  &lt;/imports&gt;
              &lt;/module&gt;
  
              &lt;module name="org.jboss.resteasy.resteasy-jettison-provider" /&gt;
              &lt;module name="org.codehaus.jettison" /&gt; 
          &lt;/dependencies&gt;
      &lt;/deployment&gt;
  &lt;/jboss-deployment-structure&gt;
  </code></pre>