title: Jersey Restful exception
body: <p>I'm facing Jersey 2.7. This is my service:</p>
  
  <pre><code>package edu.srv.rest;
  
  import javax.ws.rs.GET;
  import javax.ws.rs.POST;
  import javax.ws.rs.Path;
  import javax.ws.rs.QueryParam;
  import javax.ws.rs.core.Application;
  
  @Path("/algebra")
  public class Algebra extends Application {
  
      @GET
      @POST
      @Path("/sum")
      public int sum(@QueryParam("a") int a, @QueryParam("b") int b) {
          return a + b;
      }
  }
  </code></pre>
  
  <p>this is my web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0"&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;RS1&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
              &lt;param-value&gt;edu.srv.rest.Algebra&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;RS1&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/algebra/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>and this is my project structure:</p>
  
  <p><img src="https://i.stack.imgur.com/9R3VC.jpg" alt="project structure"></p>
  
  <p>when I try to deploy (tomcat 6, tomcat 7, tomcat 8) this service as war I got this exception:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: Could not initialize class org.glassfish.jersey.model.ContractProvider$Builder
  </code></pre>
  
  <p>what am I missing?</p>