title: Tomcat Mapper class not found
body: <p>I am creating a web app and at the moment I'm trying to get a tomcat server to run. However I get this error message when ran from the cmd line. </p>
  
  <pre><code> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tomcat/uti
     l/http/mapper/Mapper
      at org.apache.catalina.core.StandardContext.&lt;init&gt;(StandardContext.java:457)
      at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:532)
      at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:526)
      at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:207)
      at hello.Server.createTomcatServer(Server.java:34)
      at hello.Application.main(Application.java:57)
  
  Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.http.mapper.
  Mapper
  
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      ... 6 more
  </code></pre>
  
  <p>This is my pom.xml</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
   &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org     /2001/XMLSchema-instance"
  
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;org.springframework&lt;/groupId&gt;
  &lt;artifactId&gt;gs-relational-data-access&lt;/artifactId&gt;
  &lt;version&gt;0.1.0&lt;/version&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.0.0.RC4&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.h2database&lt;/groupId&gt;
          &lt;artifactId&gt;h2&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
          &lt;artifactId&gt;tomcat-catalina&lt;/artifactId&gt;
          &lt;version&gt;7.0.52&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;properties&gt;
      &lt;start-class&gt;hello.Application&lt;/start-class&gt;
  &lt;/properties&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt; 
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; 
              &lt;version&gt;2.3.2&lt;/version&gt; 
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
            &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
            &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.2&lt;/version&gt;          
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.2&lt;/version&gt;
              &lt;configuration&gt;
                &lt;!-- put your configurations here --&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                &lt;execution&gt;
                  &lt;phase&gt;package&lt;/phase&gt;
                  &lt;goals&gt;
                    &lt;goal&gt;shade&lt;/goal&gt;
                  &lt;/goals&gt;
                &lt;/execution&gt;
              &lt;/executions&gt;
            &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-snapshots&lt;/id&gt;
          &lt;name&gt;Spring Snapshots&lt;/name&gt;
          &lt;url&gt;http://repo.spring.io/libs-snapshot&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;name&gt;Spring Milestones&lt;/name&gt;
          &lt;url&gt;http://repo.spring.io/libs-milestone&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-snapshots&lt;/id&gt;
          &lt;name&gt;Spring Snapshots&lt;/name&gt;
          &lt;url&gt;http://repo.spring.io/libs-snapshot&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  </code></pre>
  
  <p></p>
  
  <p>And finally my tomcat server code:</p>
  
  <pre><code>  public void createTomcatServer() throws ServletException, LifecycleException{
  
      Tomcat tomcat = null;
      Integer webPort = new Integer(9696);
  
      tomcat.setPort(webPort);
  
      tomcat.addWebapp("/", new File(webappDirLocation).getAbsolutePath());
      System.out.println("configuring app with basedir: " + new File("./" +    webappDirLocation).getAbsolutePath());
  
      tomcat.start();
      tomcat.getServer().await();
  }
  </code></pre>
  
  <p>I thought I had included all the correct dependencies, etc. But I just cant find out why its not working - I've looked all over google already - so any help would be greatly appreciated.</p>