WildFly 10 Spring Boot war部署错误

时间:2017-10-31 08:21:01

标签: spring maven wildfly wildfly-10

由于以下错误,我无法在WildFly 10上传和部署我的Spring Boot WAR包应用程序:

  

无法上传部署:{“WFLYCTL0080:服务失败”=> {“jboss.undertow.deployment.default-server.default-host./NetonePrepaidBillingRestService”=> “服务jboss.undertow.deployment.default-server.default-host./NetonePrepaidBillingRestService中的org.jboss.msc.service.StartException:java.lang.RuntimeException:java.lang.ClassCastException:org.apache.tomcat.websocket.server .WsServerContainer无法强制转换为io.undertow.websockets.jsr.ServerWebSocketContainer引起:java.lang.RuntimeException:java.lang.ClassCastException:org.apache.tomcat.websocket.server.WsServerContainer无法强制转换为io.undertow.websockets .jsr.ServerWebSocketContainer引起:java.lang.ClassCastException:org.apache.tomcat.websocket.server.WsServerContainer无法强制转换为io.undertow.websockets.jsr.ServerWebSocketContainer“},”WFLYCTL0412:未安装的必需服务: “=> [“jboss.undertow.deployment.default-server.default-host./NetonePrepaidBillingRestService"],"WFLYCTL0180:缺少/不可用依赖项的服务”=>未定义}

以下是我的<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.rubiem</groupId> <artifactId>netone-prepaid-billing-restapi</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>netone-prepaid-billing-restapi</name> <description>Netone prepaid billing rest services</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.8.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.rubiem</groupId> <artifactId>netone-prepaid-billing</artifactId> <version>0.0.1-SNAPSHOT</version> <type>jar</type> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>1.5.8.RELEASE</version> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> <finalName>NetonePrepaidBillingRestService</finalName> </build> <repositories> <repository> <id>spring-releases</id> <url>https://repo.spring.io/libs-release</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>spring-releases</id> <url>https://repo.spring.io/libs-release</url> </pluginRepository> </pluginRepositories> </project>

#444444

1 个答案:

答案 0 :(得分:0)

如果要将WAR文件部署到任何Servlet 3容器,则应删除spring-boot-starter-undertow的依赖关系。

请参阅Spring官方网站上的这篇文章What about the Java EE Application Server?