首页 文章

WildFly 10 Spring Boot war部署错误

提问于
浏览
0

由于以下错误,我无法在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:Ser缺少/不可用依赖的恶习“=> 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>

1 回答

  • 0

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

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

相关问题