title: Java web application does not start on Tomcat 8.5 or 9 using Jersey 2.26
body: <p>I'm trying to deploy a simple Java (1.8) web application to Tomcat 9 (also tried on 8.5) using Jersey 2.26 built using Maven. I do not see any errors while building but deploying to Tomcat, the application does not start.</p>
  
  <p><a href="https://i.stack.imgur.com/AjhG2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AjhG2.png" alt="enter image description here"></a></p>
  
  <p>I was referring to the options as listed here <a href="https://jersey.github.io/documentation/latest/deployment.html#deployment.servlet.3" rel="nofollow noreferrer">https://jersey.github.io/documentation/latest/deployment.html#deployment.servlet.3</a></p>
  
  <p><strong>Errors in Tomcat logs/catalina.out</strong></p>
  
  <p><code>17-Aug-2018 21:46:06.062 SEVERE [http-nio-8080-exec-39] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/Users/konathal/Software/apache-tomcat-9.0.10/webapps/jaq-stack-webapp.war]
   java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [</code></p>
  
  <p><code>Caused by: java.lang.NoClassDefFoundError: javax/ws/rs/core/Application
      at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.addServletWithDefaultConfiguration(JerseyServletContainerInitializer.java:240)</code></p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code> &lt;dependency&gt;
     &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
     &lt;artifactId&gt;jersey-container-servlet&lt;/artifactId&gt;
     &lt;version&gt;2.26&lt;/version&gt;
   &lt;/dependency&gt;
   &lt;dependency&gt;
     &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
     &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
     &lt;version&gt;2.26&lt;/version&gt;
   &lt;/dependency&gt;
   &lt;dependency&gt;
     &lt;groupId&gt;org.glassfish.jersey.inject&lt;/groupId&gt;
     &lt;artifactId&gt;jersey-hk2&lt;/artifactId&gt;
     &lt;version&gt;2.26&lt;/version&gt;
   &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;servlet&gt;
    &lt;servlet-name&gt;javax.ws.rs.core.Application&lt;/servlet-name&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;javax.ws.rs.core.Application&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/service/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p><strong>Servlet class</strong></p>
  
  <pre><code>@Path("/dbservice")
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  public class MongoServlet {
  </code></pre>
  
  <p>What am i missing?</p>