简体   繁体   English

常量池中的字节标记无效:19 错误消息

[英]Invalid byte tag in constant pool: 19 error message

This error message shows that the Tomcat is 8.0.30, and I am using JDK 8. I am creating a Spring-boot project.这个错误信息显示Tomcat是8.0.30,我使用的是JDK 8。我正在创建一个Spring-boot项目。 Some suggested that JDK 8 should be used but I indeed am using JDK 8. What's the problem here?有人建议应该使用 JDK 8,但我确实在使用 JDK 8。这里有什么问题?

信息: Starting Servlet Engine: Apache Tomcat/8.0.30
十月 18, 2018 12:26:19 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor /home/export/Domains/nluqe.jd.com/server1/conf/Catalina/localhost/ROOT.xml
十月 18, 2018 12:26:19 下午 org.apache.catalina.core.StandardContext setPath
警告: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
十月 18, 2018 12:26:32 下午 org.apache.catalina.startup.ContextConfig processAnnotationsJar
严重: Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/export/App/nluqe.jd.com/WEB-INF/lib/lombok-1.16.22.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:55)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:176)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:85)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2011)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1961)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1936)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:586)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1777)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
十月 18, 2018 12:26:34 下午 org.apache.catalina.startup.ContextConfig processAnnotationsJar
严重: Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/export/App/nluqe.jd.com/WEB-INF/lib/log4j-api-2.10.0.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:55)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:176)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:85)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2011)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1961)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1936)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:586)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1777)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Updated (I want to configure not scanning annotation per suggestions):更新(我想根据建议配置不扫描注释):

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
    <bean id="executorService" class="java.util.concurrent.Executors" factory-method="newFixedThreadPool">
        <constructor-arg value="20"></constructor-arg>
    </bean>

    <!-- jsf -->
    <import resource="jsf-context.xml"/>


    <aop:aspectj-autoproxy proxy-target-class="true"/>


    <bean class="com.jd.ump.annotation.JAnnotation">

        <property name="systemKey" value="com.nlu-qe-service.systemKey"></property>

        <property name="jvmKey" value="com.nlu-qe-service.jvmKey"></property>
    </bean>


    </beans>

Tomcat 8.0 has reached End of Life and should not be used! Tomcat 8.0 已结束生命周期,不应使用!

The replacement is Tomcat 8.5 (implementing the same specifications as Tomcat 8.0) or Tomcat 9.0 (newer versions of specifications).替代品是 Tomcat 8.5(实现与 Tomcat 8.0 相同的规范)或 Tomcat 9.0(较新版本的规范)。 See "Migration Guide" at tomcat.apache.org.请参阅 tomcat.apache.org 上的“迁移指南”。

org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97) org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)

The BCEL library here is used to parse class files when Tomcat scans for annotations.这里的BCEL库用于Tomcat扫描注解时解析类文件。 The version that you are using does not support some features in class file format of Java 8, and thus fails when trying to parse the file.您使用的版本不支持 Java 8 类文件格式的某些功能,因此在尝试解析文件时失败。

Your options:您的选择:

  1. Ignore.忽略。
  2. Upgrade Tomcat.升级Tomcat。
  3. Exclude those jars from annotation scanning.从注释扫描中排除这些 jar。 (See the official Tomcat FAQ → Performance → How do I make Tomcat start up faster?). (请参阅官方 Tomcat FAQ → 性能 → 如何让 Tomcat 启动得更快?)。

In order to upgrade the tomcat version for the tomcat7-maven-plugin.为了升级tomcat7-maven-plugin的tomcat版本。

<properties>
    <tomcat7-version>7.0.93</tomcat7-version>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <dependencies>
                <dependency>
                    <groupId>org.apache.tomcat.embed</groupId>
                    <artifactId>tomcat-embed-core</artifactId>
                    <version>${tomcat7-version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

You can try to downgrade the version of glassfish packages in your dependencies.您可以尝试降级依赖项中的 glassfish 包的版本。 Had the problem with 2.30.1 version (and Tomcat 8.5 Server), no more issue after changing to 2.22.2. 2.30.1 版本(和 Tomcat 8.5 服务器)有问题,改成 2.22.2 后不再有问题。

    <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-client</artifactId>
        <version>2.22.2</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
      <version>2.22.2</version>
    </dependency>

I also got same issue.我也遇到了同样的问题。 I just changed aspectjrt and aspectjweaver jar version to我只是将 aspectjrt 和 aspectjweaver jar 版本更改为

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>1.8.5</version>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>1.8.5</version>
    </dependency>

Try this one might work for you also.试试这个也可能对你有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在常量池中获取无效的字节标记:19 - getting Invalid byte tag in constant pool : 19 org.apache.bcel.classfile.ClassFormatException:常量池中的无效字节标记:19 - org.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19 org.apache.tomcat.util.bcel.classfile.ClassFormatException:常量池中的无效字节标记:15 - org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15 nar-maven-plugin javah失败,常量池中的字节标记无效:18 - nar-maven-plugin javah failing with Invalid byte tag in constant pool: 18 ClassFormatException io.qameta.allure.aspects.StepsAspects:常量池中的无效字节标记:18 - ClassFormatException io.qameta.allure.aspects.StepsAspects: Invalid byte tag in constant pool: 18 引起:org.aspectj.apache.bcel.classfile.ClassFormatException:文件:'java.lang.CharSequence':常量池中的无效字节标记:18 - Caused by: org.aspectj.apache.bcel.classfile.ClassFormatException: File: 'java.lang.CharSequence': Invalid byte tag in constant pool: 18 部署Spring .ear时无效的常量池标记 - Invalid constant pool tag when deploying Spring .ear 无法执行目标org.apache.maven.plugins:maven-site-plugin:3.7:site(default-cli):常量池中的无效字节标记:18 - Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7:site (default-cli): Invalid byte tag in constant pool: 18 Scala - 错误的常量池标签 - Scala - bad constant pool tag 如何解决此 java 错误“java.io.IOException: invalid constant type: 19 at 3” - How to resolve this java error "java.io.IOException: invalid constant type: 19 at 3"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM