title: Deploy Apache Archiva on tomcat 6
body: <p>I am trying to deploy Apache Archiva on my Server, but it just fails all the time.</p>
  
  <p>specs:</p>
  
  <pre><code>os: ubuntu 10.04 
  tomcat: Apache Tomcat/6.0.24
  jvm: 1.6.0_27-b27
  
  $CATALINA_HOME : /usr/share/tomcat6
  $CATALINA_BASE : /var/lib/tomcat6
  $CATALINA_OPTS : "-Dappserver.home=$CATALINA_HOME -Dappserver.base=$CATALINA_BASE"
  
  path to lib : $CATALINA_BASE/common/lib
  
  #java -version
  java version "1.6.0_27"
  OpenJDK Runtime Environment (IcedTea6 1.12.3) (6b27-1.12.3-0ubuntu1~10.04.1)
  OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
  </code></pre>
  
  <p>Tomcat itself is up and running. I followed the instructions on this <a href="https://cwiki.apache.org/ARCHIVA/archiva-on-tomcat.html" rel="nofollow">page</a>, copied all the necessary jars to the lib (location specified above), created the <code>archiva.xml</code> in <code>/var/lib/tomcat6/conf/Catalina/localhost/</code> with that content:</p>
  
  <pre><code>&lt;Context path="/archiva" docBase="/var/lib/tomcat6/archiva/apache-archiva-1.4-M4.war"&gt;
  
    &lt;Resource name="jdbc/users"
          auth="Container"
          type="javax.sql.DataSource"
          username="philipp"
          password="xxx"
          driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
          url="jdbc:derby:////localhost:1527/archivausers;create=true" /&gt;
  
    &lt;Resource name="jdbc/archiva"
          auth="Container"
          type="javax.sql.DataSource"
          username="philipp"
          password="xxx"
          driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
          url="jdbc:derby://localhost:1527/archivadata;create=true" /&gt;
  
    &lt;Resource name="mail/Session"
          auth="Container"
          type="javax.mail.Session"
          mail.smtp.host="localhost"/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>After a click on »start« in the tomcat manager: <code>FAIL - Application at context path /archiva could not be started</code></p>
  
  <p>the last lines on the <code>catalina.out</code> are:</p>
  
  <p><code>SCHWERWIEGEND: A web application created a ThreadLocal with key of type[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@69bf9]) and a value of type [org.apache.logging.log4j.core.impl.Log4jLogEvent] (value [Logger=org.springframework.web.context.ContextLoader Level=ERROR Message=Context initialization failed]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
  11.06.2013 16:29:30 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
  SCHWERWIEGEND: A web application created a ThreadLocal with key of type [null] (value [org.apache.logging.log4j.spi.DefaultThreadContextMap$1@1ea380c]) and a value of type [null] (value [null]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.</code></p>
  
  <p>I tried more or less everything what came to my mind, but always FAIL!</p>
  
  <p>Any Idea?</p>