Hi Ho bisogno di implementare la mia primavera di avvio applicazione in wildfly 8.1 e sto ottenendo la seguente eccezione:primavera Boot WebSockets in wildfly
Causato da: java.lang.RuntimeException: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer non può essere lanciato su io.undertow.websockets.jsr.ServerWebSocketContainer su io.undertow.servlet.core.DeploymentManagerImpl.deploy (DeploymentManagerImpl.java:219) su org.wildfly. extension.undertow.deployment.UndertowDeploymentService.startContext (UndertowDeploymentService.java:87) all'indirizzo org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start (UndertowDeploymentService.java:72) in org.jboss.msc.service.ServiceControllerImpl $ StartTask.startService (ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar: 1.2.2.Final] presso org.jboss.msc.service .ServiceControllerImpl $ StartTask.run (ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar: 1.2.2.Final] ... 3 altro Causato da: java.lang.ClassCastException: org. apache.tomcat.websocket.server.WsServerContainer non può essere lanciato su io.undertow.websockets.jsr.ServerWebSocketContainer su io.undertow.websockets.jsr.Bootstrap $ WebSocketListener.contextInitialized (Bootstrap.java:69) su io.undertow. servlet.core.ApplicationListeners.contextInitialized (ApplicationListeners.java:173) su io.undertow.servlet.core.DeploymentManagerImpl.deploy (DeploymentManagerImpl.java:190) ... 7 altro
Sembra che il mio setup per websocket e messaggistica possa essere il colpevole? Stavo guardando questo https://github.com/joshlong/boot-examples/issues/2 E nessuna delle soluzioni proposte sembra funzionare per me. Qui ci sono le dipendenze dal mio pom:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.6.RELEASE</version>
</parent>
<dependencies>
<!--Testing-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${apache.httpcomponents.version}</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!--Database-->
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
</dependencies>
Ho provato ad utilizzare il direct primavera-boot-starter-websocket pure ma ottenere la stessa cosa. Ecco il mio websocket config troppo:
@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");
}
}
Grazie per aver il tempo di leggere questo. Qualsiasi aiuto mi sarebbe piaciuto di più. Inoltre, questa è la mia prima applicazione di avvio. :/
mi è stato anche di fronte lo stesso problema, mentre costruire la guerra usando Gradle. Sono stato in grado di risolvere il problema usando 'providedCompile' per' spring-boot-starter-tomcat' invece di 'compile'. –