title: Tomcat 7.0 service fails to start with ClassNotFoundException: javax.ws.rs.ProcessingException
body: <p>I have a toy REST web service that I'm trying to deploy to Tomcat 7.0 server. The problem is I can't even start the server. Here's the error message I'm getting:</p>
  
  <blockquote>
    <p>SEVERE: A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/HelloWorldRestService]]
        at java.util.concurrent.FutureTask.report(FutureTask.java:133)
        at java.util.concurrent.FutureTask.get(FutureTask.java:199)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
        at java.util.concurrent.FutureTask.run(FutureTask.java:273)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1170)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:640)
        at java.lang.Thread.run(Thread.java:853)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/HelloWorldRestService]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        ... 6 more</p>
    
    <p>Caused by: java.lang.NoClassDefFoundError: javax.ws.rs.ProcessingException
        at java.lang.J9VMInternals.prepareClassImpl(Native Method)
        at java.lang.J9VMInternals.prepare(J9VMInternals.java:1122)
        at java.lang.Class.getDeclaredFields(Class.java:685)
        at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
        at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:263)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:142)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:67)
        at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 6 more
    Caused by: java.lang.ClassNotFoundException: javax.ws.rs.ProcessingException
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
        ... 20 more</p>
    
    <p>SEVERE: A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
        at java.util.concurrent.FutureTask.report(FutureTask.java:133)
        at java.util.concurrent.FutureTask.get(FutureTask.java:199)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:691)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
        at java.lang.reflect.Method.invoke(Method.java:619)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
        at java.util.concurrent.FutureTask.run(FutureTask.java:273)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1170)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:640)
        at java.lang.Thread.run(Thread.java:853)
    Caused by: org.apache.catalina.LifecycleException: A child container failed during start
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 6 more</p>
    
    <p>SEVERE: The required Server component failed to start so Tomcat is unable to start.
    org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:691)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
        at java.lang.reflect.Method.invoke(Method.java:619)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 7 more
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 9 more
    Caused by: org.apache.catalina.LifecycleException: A child container failed during start
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 11 more</p>
  </blockquote>
  
  <p>I'm using Jersey 2.x. Here're my jars:</p>
  
  <p>javax.ws.rs-api-2.0-m10.jar</p>
  
  <p>jersey-client.jar</p>
  
  <p>jersey-common.jar</p>
  
  <p>jersey-container-servlet.jar</p>
  
  <p>jersey-container-servlet-core.jar</p>
  
  <p>jersey-server.jar</p>
  
  <p>My web.xml looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
  &lt;display-name&gt;HelloWorldRestService&lt;/display-name&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;java.helloworldrestservice.resources.HelloWorldApplication&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
  
      &lt;!-- Register JAX-RS Application, if needed. --&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
          &lt;param-value&gt;java.helloworldrestservice.resources.HelloWorldApplication&lt;/param-value&gt;
      &lt;/init-param&gt;
  
      &lt;!-- Register resources and providers under my.package. --&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
          &lt;param-value&gt;java.helloworldrestservice.resources&lt;/param-value&gt;
      &lt;/init-param&gt;
  
      &lt;!-- Enable Tracing support. --&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;jersey.config.server.tracing&lt;/param-name&gt;
          &lt;param-value&gt;ALL&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;java.helloworldrestservice.resources.HelloWorldApplication&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p></p>
  
  <p>HelloWorldApplication.java:</p>
  
  <pre><code>package java.helloworldrestservice.resources;
  
  import java.util.HashSet;
  import java.util.Set;
  import javax.ws.rs.core.Application;
  
  
  public class HelloWorldApplication extends Application 
  {
  
  @Override
  public Set&lt;Class&lt;?&gt;&gt; getClasses()
  {
      //log.info("starting the HelloWorld application...");
      Set&lt;Class&lt;?&gt;&gt; set = new HashSet&lt;Class&lt;?&gt;&gt;();
      set.add(HelloWorld.class);
      return set;
  }
  }
  </code></pre>
  
  <p>HelloWorld.java:</p>
  
  <pre><code>package java.helloworldrestservice.resources;
  
  
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.Produces;
  import javax.ws.rs.core.MediaType;
  
  @Path("/hello")
  public class HelloWorld {
  @GET
  @Produces(MediaType.TEXT_PLAIN)
  public String sayPlainTextHello()
  {
      return "Hello World!!";
  }
  }
  </code></pre>
  
  <p>What is wrong? Why do I see this missing ProcessingException class and how can I get rid of this error?</p>
  
  <p>Thanks a lot!</p>