SpringBoot 2.x war在websphere 8.5.5.11上部署失败,存在jar问题。

问题描述 投票:0回答:1

Springboot - 2.1.9.RELEASE war部署到Websphere 8.5.5.11失败。

[51720 1:05:31:181 EDT] 0000007d ecs W com.ibm.ws.ecs.Internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource module-info.class in archive WEB-INFlib-providedjaxb-api-2.3.1.jar java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader.(Unknown Source)

[51720 1:05:32:185 EDT] 0000007d ecs W com.ibm.ws.ecs.Internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource META-INFversions9module-info.class in archive WEB-INFlibbyte-buddy-1.9.16.jar java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader.(Unknown Source)

这是我的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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!-- https://medium.com/@james.tran/how-to-deploy-spring-boot-2-x-apps-on-websphere-8-5-5-d0b2e257f606 -->
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.9.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <groupId>com.lca.dbs</groupId>
    <artifactId>my-services</artifactId>
    <version>1.0.0-SNAPSHOT</version>

    <packaging>war</packaging>

    <name>demographic-bridge-services</name>
    <description>bridge services project</description>

    <properties>
        <java.version>1.8</java.version>

        <apache.common.version>4.0</apache.common.version>
        <org.mapstruct.version>1.2.0.Final</org.mapstruct.version>
        <lombok.version>1.16.16</lombok.version>

        <oracle.db.version>12.1.0.2</oracle.db.version>

        <springfox.swagger.version>2.9.2</springfox.swagger.version>
        <swagger.version>1.5.20</swagger.version>

        <junit.jupiter.version>5.6.0</junit.jupiter.version>
        <junit.vintage.version>5.6.0</junit.vintage.version>
        <mockito.version>2.18.3</mockito.version>

        <plugin.maven-compiler.version>3.7.0</plugin.maven-compiler.version>

        <jacoco.ut.destfile>${project.build.directory}/jacoco.exec</jacoco.ut.destfile>
        <jacoco.ut.datafile>${project.build.directory}/jacoco.exec</jacoco.ut.datafile>
        <jacoco.ut.reportdir>${project.reporting.outputDirectory}/jacoco-ut</jacoco.ut.reportdir>
    </properties>


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Disabled for websphere -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <!-- ORM -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jdbc</artifactId> 
            </dependency> -->

        <!-- Oracle DB Dependencies -->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc</artifactId>
            <version>${oracle.db.version}</version>
        </dependency>
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>orai18n</artifactId>
            <version>${oracle.db.version}</version>
        </dependency>

        <!-- utils -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version><!--$NO-MVN-MAN-VER$-->
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${org.mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <!-- <version>3.7</version> -->
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${apache.common.version}</version>
        </dependency>

        <!-- Swagger UI/Swagger -->
            <dependency>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-annotations</artifactId>
                <version>${swagger.version}</version>
            </dependency>
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger2</artifactId>
                <version>${springfox.swagger.version}</version>
            </dependency>
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger-ui</artifactId>
                <version>${springfox.swagger.version}</version>
            </dependency>

            <!--Unit Testing dependencies -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit.jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
                <version>${junit.vintage.version}</version>
                <scope>test</scope>
            </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${org.mapstruct.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>

        </plugins>
    </build>
</project>
java spring spring-boot websphere byte-buddy
1个回答
2
投票

这是WebSphere服务器中那个级别的已知问题,它无法处理Java SE 9模块化的jar包装(它是在产品出货后引入的)。有几个APAR可以解决围绕该包装的问题,我想你打的就是这个特定的问题。https:/www.ibm.comsupportpagesaparPI89708

当您更新到最新的 fixpack 时,这个问题应该会消失。如果因为某些原因无法解决,您必须手动删除该 JAXB jar 中 META-INF 子目录中的所有 .class 文件。

© www.soinside.com 2019 - 2024. All rights reserved.