记录一次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的区别.正因为有区别,有各 ...
随机推荐
- error: Please reinstall the libzip distribution
安装中遇到的问题 在运行 ./configure 时,提示: Please reinstall the libzip distribution 是因为 libzip 版本过低,编译升级 先卸载了原先的 ...
- 浅析Java Web框架技术
一.Java Web框架技术的概念 所谓的Java框架,简单理解是一个可复用的设计构件,它规定了应用的体系结构,阐明了整个设计.协作构件之间的依赖关系.责任分配和控制流程,表现为一组抽象类以及其实例之 ...
- python引用方法赋值问题探究
python脚本编写中,经常会遇到引用一个模块的方法的场景.引用的方法里到底赋不赋值曾经困扰了我好久. 最近利用python写了一个接口自动化测试脚本,在查阅观看多篇博文和视频后解决了封装方法引用的问 ...
- vue路由传参及组件传参和组件方法调用
VUE路由和组件传参 第一种vue自带的路由传参的三种基本方式 1.通过name :id传参 子组件通过$route.name接收参数 { path: '/particulars/:id', name ...
- 【转】Setting up SDL Extension Libraries on Code::Blocks 12.11
FROM: http://lazyfoo.net/tutorials/SDL/06_extension_libraries_and_loading_other_image_formats/window ...
- python中使用with操作文件,为什么不需要手动关闭?
python中的with关键字,它是用来启动一个对象的上下文管理器的.它的原理是,当我们使用with去通过open打开文件的时候,它会触发文件对象的上下文管理器, 当with中的代码结束完成之后,去自 ...
- Serilog 源码解析——总览
背景 大家好,考虑到在最近这些天,闲来无事,找了个类库好好研究下别人写的高质量代码,颇有收获,打算和大家分享下.考虑到最近在自学 ASP.NET Core 的相关开发,对 Serilog 这个日志记录 ...
- 文件流转blob并播放
axios 这里是请求了个mp3做例子: this.$axios({ methods:"GET", url:"/api/music/soures/双笙.mp3" ...
- python爬虫02通过 Fiddler 进行手机抓包
我们要用到一款强大免费的抓包工具 Fiddler你可以到 https://www.telerik.com/download/fiddler去下载 一般情况下 我们通过浏览器来请求服务器的时候 是点对点 ...
- MarkDown使用教程(In Atom)
程序猿都爱写博客,在写博客的过程中,大量运用的就是MarkDown语法了.MarkDown不只是用来写博客,日常生活中的感悟.工作中的心得体会.项目任务安排等等大篇幅的文章都可以用MarkDown来迅 ...