最近项目升级jdk,从jdk7 升级到 jdk8,本地已经自测完成了,需要部署到测试环境,测试环境已经装好 jdk8 了,但是tomcat 的版本还是 7。不过,据我之前了解,tomcat7是可以运行JDK8编译的web工程的,只要tomcat的运行环境的JDK是1.8即可。但是不能有比JDK1.8还要新的特性。所以最终决定不升级 tomcat 版本。

等我把项目部署到 测试环境 tomcat 下后,项目是可以跑起来的且能正常运行,但是在项目启动过程中,报了一堆错:

SEVERE: Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/.......(中间省略)....../WEB-INF/lib/jakarta.ws.rs-api-2.1.5.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:136)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:59)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:208)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:118)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2055)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1931)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1897)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1882)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1314)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:873)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:371)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

报错的不仅这一条,有很多条,分别对应不同的jar包。

我在网上苦寻解决方案,找到和实践过的方案包括下面几个:

修改web.xml 加 metadata-complete="true": https://www.cnblogs.com/ning-blogs/p/4480438.html
升级aspectjweaver的依赖: https://blog.csdn.net/guoshengkai373/article/details/53404830
升级单个jar: https://www.cnblogs.com/wxylog/p/9721332.html

这些方案,对应解决我的问题都不行,我一度产生了升级 tomcat 版本的想法,但最终我还是找到了解决方案。

参考:https://blog.csdn.net/JackRen_Developer/article/details/82288488

最终解决方案是: 修改 tomcat\conf\catalina.properties,tomcat.util.scan.DefaultJarScanner.jarsToSkip 节点增加 相应 的 jar,然后重启tomcat。

就这样,没有升级tomcat版本,问题解决。

记录一次tomcat问题排查记录:org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19的更多相关文章

  1. org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19

    在Maven上部署Struts2时,突然发生了如下错误,但是tomcat还能运行,发送错误的原因时Struts2的版本太高,和tomcat7不兼容. 开始Struts2用了2.5.20版本,后来换成2 ...

  2. maven org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 60

      maven org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant poo ...

  3. tomcat部署新的项目的时候出现报错信息: Invalid byte tag in constant pool: 15

    上面一堆tomcat启动的提示信息省略掉,下面是报错的具体信息:org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid ...

  4. org.apache.tomcat.util.bcel.classfile.ClassFormatException: null is not a Java .class file

    org.apache.tomcat.util.bcel.classfile.ClassFormatException: null is not a Java .class file   在$TOMCA ...

  5. Apache HTTP Server与Tomcat整合学习记录

    Apache HTTP Server与Tomcat整合 个人环境:Windows10,JDK8,Tomcat8.5,Apache2.4,JK模块1.2.4 前言 ​ 其实网上有很多教程,但问题是得每次 ...

  6. Apache+tomcat的整合

    http://blog.csdn.net/stefyue/article/details/6918542 为什么要做这个整合呢?当然,首先想到是就是Apache和Tomcat的区别.正因为有区别,有各 ...

  7. How to Install Apache Tomcat 8.5 on CentOS 7.3

    How to Install Apache Tomcat 8.5 on CentOS 7.3 From: https://www.howtoforge.com/tutorial/how-to-inst ...

  8. 项目抛弃Tomcat容器,用代码启动Tomcat插件

    tomato启动代码如下: package tomcat; import org.apache.catalina.connector.Connector; import org.apache.cata ...

  9. Apache+tomcat的整合 分类: C_OHTERS 2014-05-07 15:08 293人阅读 评论(0) 收藏

    http://blog.csdn.net/stefyue/article/details/6918542 为什么要做这个整合呢?当然,首先想到是就是Apache和Tomcat的区别.正因为有区别,有各 ...

随机推荐

  1. Vulkan Driver for VC4(Raspberry Pi 3b) base on mesa

    这是一篇关于在raspberry Pi 3b上移植实现vulkan 驱动的文章. 经过一段时间的代码搬运,终于实现了零的突破,可以在树莓派3B上运行Vulkan triangle/texture.当然 ...

  2. C2. Balanced Removals (Harder) (幾何、思維)

    Codeforce 1237C2 Balanced Removals (Harder) (幾何.思維) 今天我們來看看CF1237C2 題目連結 題目 給你偶數個三維座標點,每次選其中兩點,如果兩點為 ...

  3. Java 运行时动态生成class

    转载 http://www.liaoxuefeng.com/article/0014617596492474eea2227bf04477e83e6d094683e0536000 Java是一门静态语言 ...

  4. 01_cifsd 高性能网络共享服务

    01_cifsd 高性能网络共享服务 1.简介 cifsd 是一款高性能I/O网络文件共享服务, 通过一种与kernel直接交互的方式实现, github简介:https://github.com/n ...

  5. uniapp使用axios以及封装错误重试解决方案

    在uniapp中,使用axios进行请求时,uniapp无法使用axios的适配器,需要基于uni.request来定义适配器. 安装完成axios后在项目utils目录下建一个axios文件夹 文中 ...

  6. 1_Two Sum

    1.Two Sum Given an array of integers, return indices of the two numbers such that they add up to a s ...

  7. 11 幂等 Idempotence

    11 幂等 Idempotence HTTP方法的幂等性是指一次和多次请求某一个资源应该具有同样的副作用.(注意是副作用) GET http://www.bank.com/account/123456 ...

  8. (5)ASP.NET Core3.1 Ocelot服务质量

    1.服务质量(Quality of Service) 对于微服务来说,熔断就是我们常说的"保险丝",意思是当服务出现某些状况时候,通过切断服务防止应用程序不断地执行可能会失败的操作 ...

  9. solr全文检索学习

    序言: 前面我们说了全局检索Lucene,但是我们发现Lucene在使用上还是有些不方便的,例如想要看索引的内容时,就必须自己调api去查,再例如一些添加文档,需要写的代码还是比较多的 另外我们之前说 ...

  10. php 获取抖音id

    <?php public function getid($dy_url){ $header=get_headers($dy_url); $str = "/^.*?(\d+).*/&qu ...