title: java.lang.NoSuchMethodError: javax.ws.rs.core.UriBuilder.resolveTemplate() using jaxrs cxf implementation
body: <p>I am creating <code>REST</code> client using <code>jaxrs api</code> with <code>jaxrs-cfx</code> implementation.</p>
  
  <p>I am using <code>Maven</code> Build tool for dependency management which is like this :-</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;io.swagger&lt;/groupId&gt;
    &lt;artifactId&gt;swagger-jaxrs-client&lt;/artifactId&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;name&gt;swagger-jaxrs-client&lt;/name&gt;
    &lt;version&gt;1.0.0&lt;/version&gt;
    &lt;build&gt;
      &lt;sourceDirectory&gt;src/main/java&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;goals&gt;
                &lt;goal&gt;integration-test&lt;/goal&gt;
                &lt;goal&gt;verify&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        &lt;!--plugin&gt;
          &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
          &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;${jetty-version}&lt;/version&gt;
          &lt;configuration&gt;
            &lt;webApp&gt;
              &lt;contextPath&gt;/&lt;/contextPath&gt;
            &lt;/webApp&gt;
            &lt;webAppSourceDirectory&gt;target/${project.artifactId}-${project.version}&lt;/webAppSourceDirectory&gt;
            &lt;stopPort&gt;8079&lt;/stopPort&gt;
            &lt;stopKey&gt;stopit&lt;/stopKey&gt;
            &lt;httpConnector&gt;
              &lt;port&gt;&lt;/port&gt;
              &lt;idleTimeout&gt;60000&lt;/idleTimeout&gt;
            &lt;/httpConnector&gt;
          &lt;/configuration&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;start-jetty&lt;/id&gt;
              &lt;phase&gt;pre-integration-test&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;start&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;scanIntervalSeconds&gt;0&lt;/scanIntervalSeconds&gt;
                &lt;daemon&gt;true&lt;/daemon&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
            &lt;execution&gt;
              &lt;id&gt;stop-jetty&lt;/id&gt;
              &lt;phase&gt;post-integration-test&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;stop&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin--&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.9.1&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;add-source&lt;/id&gt;
              &lt;phase&gt;generate-sources&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;add-source&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;sources&gt;
                  &lt;source&gt;src/gen/java&lt;/source&gt;
                &lt;/sources&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;io.swagger&lt;/groupId&gt;
        &lt;artifactId&gt;swagger-jaxrs&lt;/artifactId&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
        &lt;version&gt;${swagger-core-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
        &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
        &lt;version&gt;${logback-version}&lt;/version&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
        &lt;artifactId&gt;logback-core&lt;/artifactId&gt;
        &lt;version&gt;${logback-version}&lt;/version&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;${junit-version}&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;!-- CXF Client --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-rs-client&lt;/artifactId&gt;
          &lt;version&gt;${cxf-version}&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  
       &lt;!-- CXF server --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-frontend-jaxrs&lt;/artifactId&gt;
          &lt;version&gt;${cxf-version}&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-rs-service-description&lt;/artifactId&gt;
          &lt;version&gt;${cxf-version}&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-ws-policy&lt;/artifactId&gt;
          &lt;version&gt;${cxf-version}&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-wsdl&lt;/artifactId&gt;
          &lt;version&gt;${cxf-version}&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;repositories&gt;
      &lt;repository&gt;
        &lt;id&gt;sonatype-snapshots&lt;/id&gt;
        &lt;url&gt;https://oss.sonatype.org/content/repositories/snapshots&lt;/url&gt;
        &lt;snapshots&gt;
          &lt;enabled&gt;true&lt;/enabled&gt;
        &lt;/snapshots&gt;
      &lt;/repository&gt;
    &lt;/repositories&gt;
    &lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;maven.compiler.source&gt;${java.version}&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;${java.version}&lt;/maven.compiler.target&gt;
      &lt;swagger-core-version&gt;1.5.9&lt;/swagger-core-version&gt;
      &lt;jetty-version&gt;9.2.9.v20150224&lt;/jetty-version&gt;
      &lt;jersey2-version&gt;2.22.2&lt;/jersey2-version&gt;
      &lt;junit-version&gt;4.12&lt;/junit-version&gt;
      &lt;logback-version&gt;1.1.7&lt;/logback-version&gt;
      &lt;servlet-api-version&gt;2.5&lt;/servlet-api-version&gt;
      &lt;cxf-version&gt;3.1.6&lt;/cxf-version&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>and my client program is like this :-</p>
  
  <pre><code>import javax.ws.rs.client.Client;
  import javax.ws.rs.client.ClientBuilder;
  import javax.ws.rs.client.WebTarget;
  import javax.ws.rs.core.Response;
  import javax.ws.rs.core.Response.Status;
  
  import com.fasterxml.jackson.core.JsonProcessingException;
  
  public class PsbClientJAXRS_GET {
  
  
      private final static String RESOURCE_URI = "http://localhost:2525/psb";
      public static void main(String[] args) throws JsonProcessingException {
  
          Client client = null;
  
          WebTarget webTarget = null;
  
          client = ClientBuilder.newClient();
  
          webTarget = client.target(RESOURCE_URI).path("/add-psbdata");
          webTarget = webTarget.path("/{name}").resolveTemplate("name", "Ram").path("/{id}").resolveTemplate("id", 101);
  
          Response response = webTarget.request().get();
  
  
          if(response.getStatus() == Status.OK.getStatusCode()){
              System.out.println("Data Passed Successfully ..... &amp; status code is " + response.getStatus());
          }
          else{
              System.out.println("Failed to hit the server. ");
          }
  
      }
  
  }
  </code></pre>
  
  <p>but when I am using resolveTemplate() method I am getting the error as :</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NoSuchMethodError:
    javax.ws.rs.core.UriBuilder.resolveTemplate(Ljava/lang/String;Ljava/lang/Object;Z)Ljavax/ws/rs/core/UriBuilder;
      at
    org.apache.cxf.jaxrs.client.spec.ClientImpl$WebTargetImpl.resolveTemplate(ClientImpl.java:403)
      at
    org.apache.cxf.jaxrs.client.spec.ClientImpl$WebTargetImpl.resolveTemplate(ClientImpl.java:396)
      at com.jaxrs.test.PsbClientJAXRS_GET.main(PsbClientJAXRS_GET.java:37)</p>
  </blockquote>
  
  <p>Please help me to resolve this issue.</p>