Invalid constant pool tag when deploying Spring .ear

Nino Gutierrez :

In my job we need to deploy an .ear file which must be java 8. But when we try to deploy, this error happens:

Caused by: com.sap.engine.library.bytecode.cf.CFException: Invalid constant pool tag, 19 at index 4.
    at com.sap.engine.library.bytecode.cf.CFParser.parse0(CFParser.java:386)
    at com.sap.engine.library.bytecode.cf.CFParser.parse(CFParser.java:307)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.parseClassInformation(ClassInfoReaderImpl.java:336)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.traverseZipFile(ClassInfoReaderImpl.java:287)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.readInternal(ClassInfoReaderImpl.java:105)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.traverseFolder(ClassInfoReaderImpl.java:175)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.readInternal(ClassInfoReaderImpl.java:103)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.traverseFolder(ClassInfoReaderImpl.java:175)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.readInternal(ClassInfoReaderImpl.java:103)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.traverseWarFile(ClassInfoReaderImpl.java:196)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.traverseFolder(ClassInfoReaderImpl.java:165)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.readInternal(ClassInfoReaderImpl.java:103)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.traverseFolder(ClassInfoReaderImpl.java:173)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.readInternal(ClassInfoReaderImpl.java:103)
    at com.sap.lib.javalang.tool.impl.ClassInfoReaderImpl.read(ClassInfoReaderImpl.java:95)
    at com.sap.engine.services.deploy.ear.jar.DplArchiveReader.parseAnnotations(DplArchiveReader.java:62)
    at com.sap.engine.services.deploy.ear.jar.EARReader.read(EARReader.java:243)
    at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.prepareNewDeploymentInfo(DeployUtilTransaction.java:251)
    at com.sap.engine.services.deploy.server.application.DeploymentTransaction.begin(DeploymentTransaction.java:199)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:423)
    ... 16 more

We believe that this issue is triggered because one of the dependencies points to some java 9 library. So i need help about which of the dependencies must be downgraded , or anything else, in order to deploy the system to java 8.

Here is the 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>cl.test</groupId>
    <artifactId>Gestio</artifactId>
    <version>0.9.3</version>
    <packaging>war</packaging>
    <name>Gestión</name>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.6.RELEASE</version>
        <relativePath />
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <m2eclipse.wtp.contextRoot>/</m2eclipse.wtp.contextRoot>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
            </dependency>

        <!-- https://mvnrepository.com/artifact/com.microsoft.azure/azure-active-directory-spring-boot-starter -->
        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-active-directory-spring-boot-starter</artifactId>
            <version>2.1.6</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-mail -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
            </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            </dependency>

        <!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-oauth2-client -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-client</artifactId>
            </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-oauth2-jose -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-jose</artifactId>
            </dependency>

        <!-- https://mvnrepository.com/artifact/com.microsoft.azure/adal4j -->
        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>adal4j</artifactId>
            <version>1.6.3</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.nimbusds/oauth2-oidc-sdk -->
        <dependency>
            <groupId>com.nimbusds</groupId>
            <artifactId>oauth2-oidc-sdk</artifactId>
            <version>5.64.4</version>
            <scope>runtime</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.webjars/bootstrap -->
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap</artifactId>
            <version>3.4.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
            </dependency>

        <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
            <version>1.18.8</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity5 -->
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-springsecurity5</artifactId>
            </dependency>

        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.4</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/libs/ojdbc6.jar</systemPath>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>qa</id>
            <properties>
                <activatedProperties>qa</activatedProperties>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>qa-agrosuper</id>
            <properties>
                <activatedProperties>qa-agrosuper</activatedProperties>
            </properties>
        </profile>
    </profiles>

    <build>
    <finalName>GestionTransportistas</finalName>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
                <version>1.16</version>
                <configuration>
                  <signature>
                    <groupId>org.codehaus.mojo.signature</groupId>
                    <artifactId>java18</artifactId>
                    <version>1.0</version>
                  </signature>
                </configuration>
                <executions>
                    <execution>
                        <id>animal-sniffer</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
              </plugin>

<!--            <plugin> -->
<!--                <artifactId>maven-ear-plugin</artifactId> -->
<!--                <version>3.0.1</version> -->
<!--                <configuration> -->
<!--                  configuration elements goes here -->
<!--                </configuration> -->
<!--              </plugin> -->

        </plugins>
    </build>
</project>
Nino Gutierrez :

I solved it. The Jaxb jar has a class that is compiled in java 9. It must be downgraded to 2.2.12 in order to deploy in java 8. You can downgrade it by adding this to the pom.xml

<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.2.12</version>
</dependency>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=310088&siteId=1