Hi I need to deploy my Spring Boot app into Wildfly 8.1 and I'm getting the following exception:
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:219) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final] ... 3 more Caused by: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer at io.undertow.websockets.jsr.Bootstrap$WebSocketListener.contextInitialized(Bootstrap.java:69) at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:190) ... 7 more
It seems that my setup for websockets and messaging might be the culprit? I was looking at this https://github.com/joshlong/boot-examples/issues/2 And none of the proposed solutions seem to work for me. Here are the dependencies from my pom:
org.springframework.boot spring-boot-starter-parent 1.1.6.RELEASE junit junit 4.11 test org.springframework.boot spring-boot-starter-test test org.apache.httpcomponents httpclient ${apache.httpcomponents.version} org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat provided org.springframework.boot spring-boot-starter-actuator org.springframework.boot spring-boot-starter-data-jpa org.springframework spring-websocket org.springframework spring-messaging org.thymeleaf thymeleaf-spring4 com.fasterxml.jackson.core jackson-databind org.hsqldb hsqldb 2.3.1 postgresql postgresql 9.1-901.jdbc4
I tried using the direct spring-boot-starter-websocket as well but get the same thing. Here is my websocket config too:
@Configuration @EnableWebSocketMessageBroker public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer{ @Override public void configureMessageBroker(MessageBrokerRegistry registry) { super.configureMessageBroker(registry); registry.enableSimpleBroker("/ssp"); registry.setApplicationDestinationPrefixes("/inc"); } @Override public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoint("/update/applications"); } }
Thanks for taking the time to read this. Any help would me most appreciated. Also, this is my first boot application. :/