title: Tomcat 8 - No Spring WebApplicationInitializer types detected on classpath
body: <p>I use maven plugin for eclipse and tomcat plugin for maven. When I use it to "clean tomcat7:deploy" my hello.war to the Tomcat 8 server on localhost it works fine. I can go to <strong>localhost:8080/hello/hello</strong> and see "Hello!" page. </p>
  
  <p>But when I deploy to Ubuntu server 15.10 in my local network and go to <strong>192.168.1.2:8080/hello/hello</strong> I get Apache Tomcat 404 error. Though tomcat manager shows that deployment went fine and my app is working.</p>
  
  <p>My thoughts were that something wrong with tomcat server on ubuntu, but when I deploy other apps to the same tomcat server on ubuntu, they work as they should. Then I thought the problem is inside my "hello" app. But if it was so, I wouldn't be able to successfully run it on my <strong>localhost</strong> tomcat server!</p>
  
  <p>When I read logs on Tomcat on Ubuntu server they say:</p>
  
  <pre><code>06-Mar-2016 10:00:00.369 INFO [http-nio-8080-exec-5] org.apache.catalina.core.ApplicationContext.log Manager: deploy: Deploying web application '/hello'
  06-Mar-2016 10:00:00.370 INFO [http-nio-8080-exec-5] org.apache.catalina.core.ApplicationContext.log Manager: Uploading WAR file to /var/lib/tomcat8/webapps/hello.war.tmp
  06-Mar-2016 10:00:18.022 INFO [localhost-startStop-3] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
  </code></pre>
  
  <p>So it seems like it can't find my Bootstrap.class class that implements Spring <strong>WebApplicationInitializer</strong> interface. Though when I check folder /var/lib/tomcat8/webapps/hello/WEB-INF/classes it contains all classes it should.</p>
  
  <p>I checked logs on <strong>localhost</strong>, and they do not complain about this.</p>
  
  <p>So at the end it seems that Tomcat 8 on Ubuntu server can not find mentioned WebApplicationInitializer. 
  I've read answers to similar questions here on stackoverflow and tried, but most of them are dealing with eclipse server settings, my problem here is different I think.</p>
  
  <p>What to do and where to look?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>When I manually deploy hello.war via /manager on localhost, everything is ok. Inside localhost.2016-03-06.log I have:</p>
  
  <pre><code>06-Mar-2016 11:34:33.081 INFO [http-nio-8080-exec-51] org.apache.catalina.core.ApplicationContext.log Spring WebApplicationInitializers detected on classpath: [by.hello.configuration.Bootstrap@19087f1e]
  06-Mar-2016 11:34:33.544 INFO [http-nio-8080-exec-51] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
  06-Mar-2016 11:34:34.026 INFO [http-nio-8080-exec-51] org.apache.catalina.core.ApplicationContext.log Initializing Spring FrameworkServlet 'springDispatcher'
  </code></pre>
  
  <p>I can go to localhost:8080/hello/hello and see "Hello!" greeting.</p>
  
  <p>When I do the same with Ubuntu server's tomcat /manager inside logs I have:</p>
  
  <pre><code>06-Mar-2016 11:36:06.555 INFO [http-nio-8080-exec-14] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
  06-Mar-2016 11:36:06.559 INFO [http-nio-8080-exec-14] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host 'localhost'
  </code></pre>