Following tutorial helped me to get a spring boot application up and running real fast: https://spring.io/guides/gs/messaging-stomp-websocket/
But now I'm stuck trying to generate a war file and deploying it on my tomcat7 application server.
I followed the [instructions][1] to create a deployable war file, but this just isn't working. I don't see any errors in the logs, but I don't see my nice sample application either when I browse to http://localhost:8080.
Here are the steps I took to generate a war file:
1) Modify pom.xml by changing the packaging to war and marking the spring-boot-starter-websocket as provided
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
</dependency>
</dependencies>
2) Modify Application.java to override the SpringBootServletInitializer configure method.
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
3) Then I run
mvn clean package
and deploy the generated war-file, but I just keep getting the default Tomcat welcome page, when I browse to http://localhost:8080/.
I also tried changing the application contextPath by adding the following application.properties:
server.contextPath=/websocketclient
server.port=8082
But this doesn't solve the problem.