SOLVED: I converted the application from spring-boot to standard spring mvc and it now works. Thanks for everyone who tried to help. Still not sure what the issue was but I've got it working now.
I'm trying to deploy webapps to tomcat 7. The apps are built using spring-boot and packaged using maven.
I am placing the wars in the webapps folder and it is being deployed successfully:
Jul 31, 2015 1:22:05 PM org.apache.catalina.startup.HostConfigdeployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/application.war
Jul 31, 2015 1:22:09 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/Application.war
Jul 31, 2015 1:22:10 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Jul 31, 2015 1:22:11 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 31, 2015 1:22:11 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6796 ms
However, when I try to access them through the browser I get a 404 message (The requested resource is not available.). I can see the ROOT index and get to the manager app, where they are correctly identified as Spring MVC and I am told they are deployed and running. Clicking on the link within the manager gives me the same result. catalina.out isn't telling me anything. It doesn't give me anymore information after the server startup message.
EDIT WITH MORE INFO This is the web.xml for the application
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>Spring MVC Application</display-name>
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Controller handling index requests:
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/")
/**
* Default Controller.
*/
class HelloController {
/**
* Implementation of logging interface in SL4J.
*/
private static final Logger LOGGER = LoggerFactory.getLogger
(HelloController.class);
/**
* Constructs a new Hello Controller
*/
public HelloController() {
LOGGER.trace("Created hello controller");
}
/**
* Prints the message on the screen
* @param model the model to add the message too
* @return a String
*/
@RequestMapping(method = RequestMethod.GET)
public String printWelcome(final ModelMap model) {
model.addAttribute("message", "Hello world!");
return "hello";
}
}
The urls I am trying to access are http://localhost:8080/application/ and http://localhost:8080/Application/
I have also tried it in Tomcat 8 and get the same issue. I tried copying the ROOT folder and renaming the copy to application and can access that fine. Seems to be something with the war?