WildFly 10 Spring Boot war 部署错误 [英] WildFly 10 Spring Boot war Deployment Error

查看:152
本文介绍了WildFly 10 Spring Boot war 部署错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I cannot upload and deploy my Spring Boot WAR package application on WildFly 10 because of the following error:

无法上传部署:{"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缺少/不可用依赖项的服务" => 未定义}

Cannot upload deployment: {"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 cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer Caused by: java.lang.RuntimeException: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer Caused by: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer"},"WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host./NetonePrepaidBillingRestService"],"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined}

以下是我的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>

推荐答案

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

You should remove the dependency of spring-boot-starter-undertow if you want to deploy your WAR file to any Servlet 3 container.

另请参考这篇文章Java EE Application Server 怎么样? Spring 官网.

Please also refer to this article What about the Java EE Application Server? on Spring official website.

这篇关于WildFly 10 Spring Boot war 部署错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆