程序启动时报: Invalid byte tag in constant pool: 19

简介: 程序启动时报: Invalid byte tag in constant pool: 19

今天系统部署到新的测试机上面出现一个问题

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:2042)
  at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1988)
  at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1958)
  at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1912)
  at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1157)
  at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:779)
  at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:306)
  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:5150)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
  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.deployDirectory(HostConfig.java:1092)
  at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
  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:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at java.lang.Thread.run(Thread.java:748)

搜索了一下,有网友遇到过相似的情况,这个问题的原因是有些jar中增加了jdk9特性Module,Package信息,在这些包中可以找到module-info.class,其jdk版本号也对应1.9。比如我项目中受影响的jar是apiguardian-api-1.1.0.jar和stax-ex-1.8.jar,还有jaxb-runtime-2.3.1.jar等等,而这些包中其他的class文件版本号并没有升级到1.9,而tomcat启动时,会尝试解析这些类,解析到module-info.class时,导致了报错。

解决办法是建议将tomcat升级到8.0最新版本,如8.5,9.0

相关文章
|
5月前
|
编解码 程序员 开发者
【Python】已解决:UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xa1 in position 0: invalid start by
【Python】已解决:UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xa1 in position 0: invalid start by
5450 0
|
编解码 Python
pandas - read_csv报错:‘utf-8‘/‘gbk‘ codec can‘t decode byte 0xb1 in position 0:invalid start byte
pandas - read_csv报错:‘utf-8‘/‘gbk‘ codec can‘t decode byte 0xb1 in position 0:invalid start byte
447 0
|
7月前
|
Java 应用服务中间件
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
1340 0
|
存储 编解码 JavaScript
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb0 in position 53: invalid start byte
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb0 in position 53: invalid start byte
237 0
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb0 in position 53: invalid start byte
|
编解码 Python
pandas读取csv错误UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 0: invalid start byte
pandas读取csv错误UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 0: invalid start byte
729 0
|
编解码 Python
问题解决:UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xcf in position 0: invalid continuation by
问题解决:UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xcf in position 0: invalid continuation by
3672 0
问题解决:UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xcf in position 0: invalid continuation by
|
编解码 Python
Python ‘utf-8‘ codec can‘t decode byte 0x8b in position 1: invalid start byte
Python ‘utf-8‘ codec can‘t decode byte 0x8b in position 1: invalid start byte
234 0
|
XML Java 应用服务中间件
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
302 0
|
编解码 前端开发
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd6 in position 120: invalid continuation byte
学习UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd6 in position 120: invalid continuation byte。
278 0
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd6 in position 120: invalid continuation byte
|
编解码 Python
【pandas问题】UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xca in position 0: invalid continuati
【pandas问题】UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xca in position 0: invalid continuati
503 0