0

I try to follow this tutorial: Using WebSocket to build an interactive web application.

I use eclipse, debian10, maven 3.6, jdk1.8, tomcat8.

After importing the git project I want to run the "complete" folder. However I get the following error: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server [...]

I did not edit anything so I am really confused where this error might come from.

tldr
  • 21
  • 1
  • 1
  • 3

2 Answers2

2

If the port is already used, you could simply change the port by adding this line to application.properties:

server.port=8081

Baeldung

Vladimir Shefer
  • 661
  • 3
  • 19
1

Apparently the port 8080 was already in use. I solved the issue by simply changing the port of the spring boot application like this

edited MessagingStompWebsocketApplication.java

@SpringBootApplication
public class MessagingStompWebsocketApplication {
  public static void main(String[] args) {
    SpringApplication app = new SpringApplication(MessagingStompWebsocketApplication.class);
    app.setDefaultProperties(Collections.singletonMap("server.port","8089"));
    app.run(args);
  }
}
Vladimir Shefer
  • 661
  • 3
  • 19
tldr
  • 21
  • 1
  • 1
  • 3