【问题标题】:WildFly 10 Spring Boot war Deployment ErrorWildFly 10 Spring Boot 战争部署错误
【发布时间】:2018-04-12 08:22:20
【问题描述】:

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

无法上传部署:{"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./NetonePrepaidBillingRestService" => "org.jboss.msc.service.StartException in service jboss .undertow.deployment.default-server.default-host./NetonePrepaidBillingRestService: 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: Se缺少/不可用依赖项的服务” => 未定义}

以下是我的pom.xml

<?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>

【问题讨论】:

    标签: spring maven wildfly wildfly-10


    【解决方案1】:

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

    另请参考Spring官网What about the Java EE Application Server?这篇文章。

    【讨论】:

      猜你喜欢
      • 2019-03-23
      • 1970-01-01
      • 2018-07-05
      • 2019-03-21
      • 2015-10-28
      • 2016-09-08
      • 2017-09-21
      • 2016-08-16
      • 1970-01-01
      相关资源
      最近更新 更多