title: Spring Java Config: Tomcat deploy without web.xml
body: <p>I built a java configured Spring MVC application without any XML. I can deploy and start the application on my laptop without any problems. But as soon as I try to deploy my application on my testserver (tomcat 7), I receive following message:</p>
  
  <pre><code>HTTP Status 404 - The requested resource (/[application context]/) is not available.
  </code></pre>
  
  <p>I build my applications using the Eclipse Maven plugin. Is it possible to deploy the application without the web.xml and if not, which is the basic web.xml I really need?</p>
  
  <p>Maven WAR Plugin:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
      &lt;version&gt;${maven.war.plugin.version}&lt;/version&gt;
      &lt;configuration&gt;
          &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>WebAppInitializer:</p>
  
  <pre><code>@Order(value = 1)
  public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
  
      @Override
      public void onStartup(ServletContext servletContext) throws ServletException {
          super.onStartup(servletContext);
      }
  
      @Override
      protected Class&lt;?&gt;[] getRootConfigClasses() {
          return new Class[] { HibernateConfig.class, SecurityConfig.class, HibernateDaoConfig.class };
      }
  
      @Override
      protected Class&lt;?&gt;[] getServletConfigClasses() {
          return new Class[] { WebAppConfig.class };
      }
  
      @Override
      protected String[] getServletMappings() {
          return new String[] { "/" };
      }
  
      @Override
      protected Filter[] getServletFilters() {
          return new Filter[]{};
      }
  }
  </code></pre>
  
  <p>Update: catalina.out</p>
  
  <pre><code>Feb 3, 2014 4:18:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/[appname]] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
  Feb 3, 2014 4:18:33 PM org.apache.catalina.startup.HostConfig checkResources
  INFO: Undeploying context [/[appname]]
  Feb 3, 2014 4:18:45 PM org.apache.catalina.startup.HostConfig deployWAR
  INFO: Deploying web application archive [appname].war
  </code></pre>