title: Can't deploy war to tomcat with maven plugin
body: <p>If I manually deploy my web app to tomcat 6, everything works. But when I attempt to do the same with maven6-tomcat-plugin it won't deploy. A host error follows, not one of which makes any sense (from catalina.out log file):</p>
  
  <ol>
  <li><p>INFO: validateJarFile(/var/lib/tomcat6/webapps/spring_sec/WEB-INF/lib/servlet-api-2.5.jar) - jar not loaded. This is simply not true; I unzipped the war file and the file is clearly present.</p></li>
  <li><p>SEVERE: Creation of the naming context failed: javax.naming.NamingException: Context is read only.</p></li>
  <li><p>SEVERE: Error deploying web application archive spring_sec.war java.lang.NoClassDefFoundError: org/springframework/beans/factory/Aware. Another untrue statement; after unzipping the war package I found WEB-INF/lib/spring-beans-3.1.1.RELEASE.jar file which contains the desired class.</p></li>
  </ol>
  
  <p>Is it the same thing to manually deploy the war file to tomcat and to use the maven plugin?</p>
  
  <p><strong>Maven output for command mvn tomcat6:deploy after mvn clean:</strong></p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building SpringSec 0.1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] &gt;&gt;&gt; tomcat6-maven-plugin:2.0-beta-1:deploy (default-cli) @ spring_sec &gt;&gt;&gt;
  [INFO]
  [INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ spring_sec ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory /media/winchester/spring_sec/src/main/resources
  [INFO]
  [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ spring_sec ---
  [INFO] Compiling 1 source file to /media/winchester/spring_sec/target/classes
  [INFO]
  [INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ spring_sec ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory /media/winchester/spring_sec/src/test/resources
  [INFO]
  [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ spring_sec ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO]
  [INFO] --- maven-surefire-plugin:2.10:test (default-test) @ spring_sec ---
  [INFO] No tests to run.
  [INFO] Surefire report directory: /media/winchester/spring_sec/target/surefire-reports
  
  -------------------------------------------------------
   T E S T S
  -------------------------------------------------------
  
  Results :
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  
  [INFO]
  [INFO] --- maven-war-plugin:2.2:war (default-war) @ spring_sec ---
  [INFO] Packaging webapp
  [INFO] Assembling webapp [spring_sec] in [/media/winchester/spring_sec/target/spring_sec-0.1.0-SNAPSHOT]
  [INFO] Processing war project
  [INFO] Copying webapp resources [/media/winchester/spring_sec/src/main/webapp]
  [INFO] Webapp assembled in [40 msecs]
  [INFO] Building war: /media/winchester/spring_sec/target/spring_sec-0.1.0-SNAPSHOT.war
  [INFO] WEB-INF/web.xml already added, skipping
  [INFO]
  [INFO] &lt;&lt;&lt; tomcat6-maven-plugin:2.0-beta-1:deploy (default-cli) @ spring_sec &lt;&lt;&lt;
  [INFO]
  [INFO] --- tomcat6-maven-plugin:2.0-beta-1:deploy (default-cli) @ spring_sec ---
  [INFO] Deploying war to ***:8080/spring_sec
  Uploading: ***:8080/manager/html/deploy?path=%2Fspring_sec
  3211/3211 KB
  Uploaded: ***:8080/manager/html/deploy?path=%2Fspring_sec (3211 KB at 50171.2 KB/sec)
  [INFO] FAIL - Failed to deploy application at context path /spring_sec
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 4.280s
  [INFO] Finished at: Thu Apr 19 22:07:39 EEST 2012
  [INFO] Final Memory: 15M/144M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>** Maven pom: **</p>
  
  <pre><code>&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;com.denarced&lt;/groupId&gt;
    &lt;artifactId&gt;spring_sec&lt;/artifactId&gt;
    &lt;version&gt;0.1.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
  
    &lt;name&gt;SpringSec&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;version&gt;3.1.1.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
          &lt;version&gt;3.1.1.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;version&gt;3.1.1.RELEASE&lt;/version&gt;
      &lt;/dependency&gt; 
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;
          &lt;version&gt;3.1.1.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.2&lt;/version&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.3.2&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.6&lt;/source&gt;
            &lt;target&gt;1.6&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
          &lt;artifactId&gt;tomcat6-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.0-beta-1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;server&gt;lapserver&lt;/server&gt;
            &lt;url&gt;http://192.168.11.7:8080/manager/html&lt;/url&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>