集成最新框架后,在tomcat8比较旧的版本中启动会报一些 Invalid byte tag in constant pool: 19
六月 11, 2019 5:42:48 下午 org.apache.catalina.startup.ContextConfig processAnnotationsJar 严重: Unable to process Jar entry [module-info.class] from Jar [file:publiccms/WEB-INF/lib/FastInfoset-1.2.15.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: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:5202) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397) 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)
原因是有些jar中增加了jdk9特性Module信息,在这些包中可以找到module-info.class,其jdk版本号也对应1.9
但是这些包中其他的class文件版本号并没有升级到1.9
而tomcat启动时,会尝试解析这些类,解析到module-info.class时,导致了报错。经过一段时间的测试 暂时没发现有兼容性问题
不过为了稳定 也为了屏蔽这些错误 还是建议将tomcat升级到8.0最新版本,或8.5,9.0
标签:tomcat
0条评论
发表评论