title: Spring Boot Deployed in Tomcat gives 404 but works Stand-alone
body: <p>I have been testing Spring Boot with embedded Tomcat for about a month now to build a REST API. Everything was working fine. We now want to deploy the API in a separate development environment which has a couple of other (non-Spring) applications running on a Tomcat container.</p>
  
  <p>I made the changes specified in <a href="http://spring.io/guides/gs/convert-jar-to-war-maven/">Converting a Spring Boot JAR Application to a WAR using Maven</a> and <a href="http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-packaging">Spring Boot Docs</a>.</p>
  
  <p>The deployment goes well (logs are fine, no errors) and looking at Tomcat management i see my application deployed. However, when I attempt to access <a href="http://localhost:8080/sophia/users">http://localhost:8080/sophia/users</a> in curl I get 404.</p>
  
  <p>Any help is much appreciated.</p>
  
  <p>UPDATE:</p>
  
  <p>Here are my logs:</p>
  
  <p>Netbeans:</p>
  
  <blockquote>
    <p>NetBeans: Deploying on Apache Tomcat 8.0.17
        profile mode: false
        debug mode: false
        force redeploy: true</p>
    
    <p>In-place deployment at /home/bugz/workspace/pdcore/sophiaserver/target/sophia-server-1.0.0-SNAPSHOT</p>
    
    <p>Deployment is in progress...</p>
    
    <p>deploy?config=file%3A%2Ftmp%2Fcontext1845402702541504208.xml&amp;path=/sophia</p>
    
    <p>OK - Deployed application at context path /sophia</p>
    
    <p>Start is in progress...</p>
    
    <p>start?path=/sophia</p>
    
    <p>OK - Started application at context path /sophia</p>
  </blockquote>
  
  <p>Tomcat:</p>
  
  <blockquote>
    <p>INFO 10:47:52:703 org.springframework.boot.context.embedded.ServletRegistrationBean - Mapping servlet: 'dispatcherServlet' to [/sophia/*]</p>
    
    <p>INFO 10:47:54:042 org.springframework.boot.SpringApplication - Started application in 8.285 seconds (JVM running for 12087.301)</p>
    
    <p>22-Jan-2015 10:47:54.060 INFO [http-nio-8080-exec-99] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor /home/bugz/workspace/server/apache-tomcat-8.0.17/conf/Catalina/localhost/sophia.xml has finished in 12,091 ms</p>
  </blockquote>
  
  <p>And in sophia.xml for Catalina localhost:</p>
  
  <p></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Context antiJARLocking="true" docBase="/home/bugz/workspace/pdcore/sophiaserver/target/sophia-server-1.0.0-SNAPSHOT" path="/sophia"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>I've tried accessing</p>
  
  <ol>
  <li><a href="http://localhost:8080/sophia/users">http://localhost:8080/sophia/users</a></li>
  <li><a href="http://localhost:8080/sophia-server-1.0.0-SNAPSHOT/users">http://localhost:8080/sophia-server-1.0.0-SNAPSHOT/users</a> (name of WAR)</li>
  </ol>
  
  <p>The first returns a 404 but with the CORS information from my CORS filter bean. The second return 404 without CORS information (which indicates the application has started and is configured but I do not seem to have access to the Controllers).</p>