记录一次tomcat问题排查记录:org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
最近项目升级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的更多相关文章
- org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
在Maven上部署Struts2时,突然发生了如下错误,但是tomcat还能运行,发送错误的原因时Struts2的版本太高,和tomcat7不兼容. 开始Struts2用了2.5.20版本,后来换成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 ...
- tomcat部署新的项目的时候出现报错信息: Invalid byte tag in constant pool: 15
上面一堆tomcat启动的提示信息省略掉,下面是报错的具体信息:org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid ...
- 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 ...
- Apache HTTP Server与Tomcat整合学习记录
Apache HTTP Server与Tomcat整合 个人环境:Windows10,JDK8,Tomcat8.5,Apache2.4,JK模块1.2.4 前言 其实网上有很多教程,但问题是得每次 ...
- Apache+tomcat的整合
http://blog.csdn.net/stefyue/article/details/6918542 为什么要做这个整合呢?当然,首先想到是就是Apache和Tomcat的区别.正因为有区别,有各 ...
- 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 ...
- 项目抛弃Tomcat容器,用代码启动Tomcat插件
tomato启动代码如下: package tomcat; import org.apache.catalina.connector.Connector; import org.apache.cata ...
- Apache+tomcat的整合 分类: C_OHTERS 2014-05-07 15:08 293人阅读 评论(0) 收藏
http://blog.csdn.net/stefyue/article/details/6918542 为什么要做这个整合呢?当然,首先想到是就是Apache和Tomcat的区别.正因为有区别,有各 ...
随机推荐
- 【垃圾回收-CMS】Java内存回收实践经验 防止内存报警
jdk6和7服务器端(-server) 默认的新生代的垃圾回收器为:PS Scavenge,老年代默认的垃圾回收器为:PS MarkSweep 目前项目使用了jdk7,tomcat7,经常出现内存堆使 ...
- Centos 7 firewall 命令
Centos 7 firewall 命令: 查看已经开放的端口: firewall-cmd --list-ports 开启端口 firewall-cmd --zone=public --add-por ...
- APP后台架构20191205
1.架构,架构与业务紧密相关,是有业务驱动的. 2.APP后台演进原则. App后台的架构是由业务规模驱动而演进的,App后台是为业务服务的,App后台的价值在于能为业务提供其所需要的功能,不应过度设 ...
- npm ande gulp cmd
在学习前,先谈谈大致使用gulp的步骤,给读者以初步的认识.首先当然是安装nodejs,通过nodejs的npm全局安装和项目安装gulp,其次在项目里安装所需要的gulp插件,然后新建gulp的配置 ...
- Redis---06主从复制(薪火相传)
一.什么是薪火相传模式 上一个slave(从机)是下一个slave(从机)的Master(主机) 二.为什么要这样 优点:从机同样可以接收其他从机的连接和同步请求,那么该从机作为了链条中下一个的主机, ...
- LoRa技术的特点和组成系统分析
目前,基于LoRa技术的网络层协议主要是LoRaWAN,也有少量的非LoRaWAN协议,但是通信系统网络都是星状网架构,以及在此基础上的简化和改进.主要包括以下3种. (1)点对点通信. 一点对一点通 ...
- python数据分析使用matplotlib绘图
matplotlib绘图 关注公众号"轻松学编程"了解更多. Series和DataFrame都有一个用于生成各类图表的plot方法.默认情况下,它们所生成的是线形图 %matpl ...
- .netcore 简单使用ElasticSearch
.netcore 简单使用ElasticSearch(7.6) 最近在捣鼓学习了下ElasticSearch,在此记录下使用.netcore操作elastic search 的实现(简单的封装,使用) ...
- c#三角形
int n = 10; for (int i = 1; i <= n; i++) { Console.Write(new string(' ', n - i)); for (int j = 1; ...
- 剑指41和为s的连续整数序列
题目描述 小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100.但是他并不满足于此,他在想究竟有多少种连续的正数序列的和为100(至少包括两个数).没多久,他 ...