title: AbstractMethodError using UriBuilder on JAX-RS
body: <p>I am trying to build a REST webservice using an asynchronous response.</p>
  
  <p>I have looked around this error on the web, however, none of the solutions have worked for me. I am not sure on how to go about it.</p>
  
  <p>This is the code for the REST service, it has AsyncResponse, and <code>@Suspended</code> which are taken from jar file specified in the <code>pom.xml</code>, which I will provide below. The problem is, on deploying the war, I get an exception:</p>
  
  <pre><code>java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
      javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
      com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:651)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  note The full stack trace of the root cause is available in the Apache Tomcat/7.0.50 logs
  </code></pre>
  
  <p>My class is as follows:</p>
  
  <pre><code>package com.crudapp;
  
  import java.util.ArrayList;
  import java.util.List;
  import java.util.concurrent.Callable;
  import java.util.concurrent.ExecutorService;
  import java.util.concurrent.Executors;
  import java.util.concurrent.Future;
  
  import javax.annotation.Generated;
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.Produces;
  import javax.ws.rs.QueryParam;
  import javax.ws.rs.core.Response;
  //import javax.ws.rs.core.UriBuilder;
  
  import org.json.JSONArray;
  import org.json.JSONObject;
  import org.springframework.context.support.ClassPathXmlApplicationContext;
  
  import com.google.gson.Gson;
  import com.mysql.jdbc.StringUtils;
  
  import dao.User;
  import dao.UserDAO;
  import dao.UserDAOImpl;
  
  import javax.ws.rs.container.AsyncResponse;
  import javax.ws.rs.container.Suspended;
  
  @Path("/crudpath")
  public class EntityResource {
  
         private final ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/spring.xml");
         UserDAO userdao = null;
         private final int numOfThreads = 10;
         private final ExecutorService executorService = Executors.newFixedThreadPool(numOfThreads);
        // userdao.getUsers("118");
  
         //ctx.close();
      @GET
      @Produces("application/json")
      public Response getTupleFromDBasJSON(@QueryParam("param1") String userid, @Suspended final AsyncResponse asyncresponse ){
  
          if(StringUtils.isNullOrEmpty(userid))
              throw new ServiceException("Userid passed to the REST service /crudpath is null or empty");
          userdao = (userdao==null)?  
                  ctx.getBean("userDAO", UserDAOImpl.class)
                  : userdao;
          Gson gson = new Gson();
  
          Future&lt;List&lt;User&gt;&gt; futures = executorService.submit(new DAOTaskHandlerThread(userid));
          List &lt;User&gt; users = new ArrayList&lt;User&gt;();
          if(futures.isDone())
          {
              try{
              users = futures.get();
              if(users!= null)
                return     Response.status(200).entity( gson.toJson(users).toString()).build();
              }
              catch(Exception ex)
              {
                  throw new ServiceException(ex);
              }
          }
  
          return Response.status(200).entity(new ArrayList&lt;User&gt;().toString()).build();
  
          /*// crrate  a new thread.. call the DAO .. returns the result from here.
          JSONObject jsonObject = new JSONObject();
          jsonObject.put("key", "value");
          return Response.status(200).entity( jsonObject.toString()).build();*/
      }
  
      private class DAOTaskHandlerThread implements Callable&lt;List&lt;User&gt;&gt;{
  
          //private UserDAO userDAO;
          private String userid;
          private DAOTaskHandlerThread(//UserDAO userDAO,
                  String useridpassed){
              ///this.userDAO= userDAO;
              userid= useridpassed;
          }
          @Override
          public List&lt;User&gt; call() throws Exception {
              // TODO Auto-generated method stub
              return userdao.getUsers(userid);
          }
  
      }
  
  }
  </code></pre>
  
  <p>My <code>pom.xml</code> file for maven is as follow:</p>
  
  <pre class="lang-xml prettyprint-override"><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/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;RESTJerseyExample&lt;/groupId&gt;
      &lt;artifactId&gt;RESTJerseyExample&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;build&gt;
          &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;!-- spring framework just added --&gt;
  
      &lt;properties&gt;
          &lt;java-version&gt;1.7&lt;/java-version&gt;
          &lt;org.springframework-version&gt;4.0.3.RELEASE&lt;/org.springframework-version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- spring framework just added ends here --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;asm&lt;/groupId&gt;
              &lt;artifactId&gt;asm&lt;/artifactId&gt;
              &lt;version&gt;3.3.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-bundle&lt;/artifactId&gt;
              &lt;version&gt;1.19&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.json&lt;/groupId&gt;
              &lt;artifactId&gt;json&lt;/artifactId&gt;
              &lt;version&gt;20140107&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
              &lt;version&gt;1.19&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
              &lt;version&gt;1.19&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp2&lt;/artifactId&gt;
              &lt;version&gt;2.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!--  used for httpclient library --&gt;   
          &lt;dependency&gt;
              &lt;groupId&gt;commons-io&lt;/groupId&gt;
              &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
              &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
              &lt;version&gt;4.3.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!--  for async response  --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
              &lt;artifactId&gt;javax.ws.rs-api&lt;/artifactId&gt;
              &lt;version&gt;2.0-m12&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>