title: Jersey com.sun.jersey.spi.container.servlet.ServletContainer error when using MAVEN
body: <p>When I'm attempting to build a simple test application in Eclipse using Jersey.  When I try to run my app I get this exception:</p>
  
  <p>java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer</p>
  
  <p>I've researched answers to this question here on Stack Overflow and have verified these things:</p>
  
  <p>It is true that the missing class does not exists in jersey-server any more.  That class now exists in jersey-servlet (Notice "servlet", not "server"). So my maven dependencies now look like this:</p>
  
  <pre><code>&lt;dependencies&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;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-servlet&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-server&lt;/artifactId&gt;
          &lt;version&gt;1.19&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>And my web.xml looks like this</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;jersey-helloworld-serlvet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
                   com.sun.jersey.spi.container.servlet.ServletContainer
              &lt;/servlet-class&gt;
      &lt;init-param&gt;
           &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
           &lt;param-value&gt;com.javacodegeeks.enterprise.rest.jersey&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;jersey-helloworld-serlvet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I can now look at my project in Eclipse and under Java Resources/Libraries/Maven Dependencies I can see the file jersey-servlet-1.19.jar and in that jar I can see the com.sun.jersey.spi.container.servlet package and within that package I can see the ServletContainer.class file.</p>
  
  <p>So everything appears to be correct, and yet when the server (apache 7.0) starts it can't find the class which is clearly there.</p>
  
  <p>Thank you for any advice you may have.</p>