2

I am developing a spring mvc project. Sometimes while starting my SpringBoot application I am getting following error.

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.ClassCastException:

The detail logs is mention below:

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.ClassCastException: org.apache.tomcat.websocket.WsWebSocketContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Amit
  • 37
  • 3
  • 10

1 Answers1

2

Remove this in your pom.xml :)

   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-undertow</artifactId>
    </dependency>
habit23
  • 29
  • 2