title: Servlet UnavailableException:No class in holder while starting jetty
body: <p>Can anyone tell me what causes this exception while jetty server is starting. I am using jetty 9.2.2</p>
  
  <p>javax.servlet.UnavailableException: No class in holder</p>
  
  <p>The web.xml contains</p>
  
  <pre><code>&lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;com.test.api.TestApiApplication&lt;/servlet-name&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;com.test.api.TestApiApplication&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/v1/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>The TestApiApplication.java extends Application</p>
  
  <pre><code>public class TestApiApplication extends Application {
  
   public TestApiApplication() {
   }
  
  @Override
   public Set&lt;Class&lt;?&gt;&gt; getClasses() {
      Set&lt;Class&lt;?&gt;&gt; s = new HashSet&lt;Class&lt;?&gt;&gt;();
      s.add(TestResource.class);
      return s;
   } 
  }
  </code></pre>
  
  <p>The drilled down version of my pom.xml is:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;jersey.version&gt;2.11&lt;/jersey.version&gt;
      &lt;spring.framework.version&gt;4.0.6.RELEASE&lt;/spring.framework.version&gt;
      &lt;jaxrs.version&gt;2.0&lt;/jaxrs.version&gt;
  &lt;/properties&gt;
  &lt;dependencies&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
          &lt;version&gt;3.1.0&lt;/version&gt;
      &lt;/dependency&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&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-container-servlet-core&lt;/artifactId&gt;
          &lt;version&gt;${jersey.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &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;${jersey.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-json&lt;/artifactId&gt;
          &lt;version&gt;1.18.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-container-jetty-servlet&lt;/artifactId&gt;
          &lt;version&gt;2.11&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>The complete stack trace is:</p>
  
  <pre><code>javax.servlet.UnavailableException: No class in holder
      at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:88)
      at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:332)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:868)
      at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
      at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1341)
      at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1334)
      at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
      at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:497)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
      at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
      at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:498)
      at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:146)
      at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
      at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
      at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)
      at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:528)
      at org.eclipse.jetty.util.Scanner.scan(Scanner.java:391)
      at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:560)
      at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:235)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
      at org.eclipse.jetty.server.Server.start(Server.java:380)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
      at org.eclipse.jetty.server.Server.doStart(Server.java:347)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at yjava.servlet.container.jetty.JettyDaemon.start(JettyDaemon.java:40)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)
  </code></pre>