Spring Boot应用程序deploymnet在Liberty中引发类强制转换异常

时间:2018-07-17 14:17:28

标签: spring-boot websphere-liberty open-liberty

当我尝试将已经构建的spring boot应用程序部署到Liberty 8.5时出现错误。我们正在使用mavenSpring boot 1.5.7

POM.XML:

<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.demo.smartdemo</groupId>
<artifactId>smartdemo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>smartdemo</name>
<url>http://maven.apache.org</url>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.7.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <start-class>com.demo.smartdemo.SmartDemoLauncher</start-class>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>
    <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-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>com.jayway.jsonpath</groupId>
        <artifactId>json-path</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <start-Class>com.demo.smartdemo.SmartDemoLauncher</start-Class>

            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>repackage</goal>
                    </goals>
                    <configuration>
                        <classifier>exec</classifier>
                        <start-Class>com.demo.smartdemo.SmartDemoLauncher</start-Class>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <finalName>provider</finalName>
</build>
</project>

Application.xml-自由:

    <featureManager>
        <feature>springBoot-1.5</feature>
        <feature>servlet-3.1</feature>
    </featureManager>   
    <springBootApplication location="provider.jar" type="jar">
        <classloader delegation="parentLast"/>
    </springBootApplication>

启动服务器时出现异常。

  

CWWKZ0002E:启动应用程序提供程序时发生异常。异常消息为:java.lang.ClassCastException:com.ibm.ws.app.manager.springboot.internal.SpringBootModuleInfo无法转换为com.ibm.ws.container.service.app.deploy.WebModuleInfo

0 个答案:

没有答案