Tomcat运行时出现Unable to process Jar entry [module-info.class] from Jar
分析报错可知无法从Jar包中处理Jar条目[module-info.class]
报错内容
严重: Unable to process Jar entry [module-info.class] from Jar [jar:file:/D:/STS/Workspaces/Cloudview/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/task-starter/WEB-INF/lib/jaxb-api-2.3.1.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:2011) at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1961) at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1936) at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305) 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:5154) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) 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) 五月 10, 2019 9:25:46 上午 org.apache.catalina.startup.ContextConfig processAnnotationsJar 严重: Unable to process Jar entry [META-INF/versions/9/module-info.class] from Jar [jar:file:/D:/STS/Workspaces/Cloudview/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/task-starter/WEB-INF/lib/byte-buddy-1.9.12.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:2011) at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1961) at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1936) at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305) 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:5154) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) 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)
解决办法一
找到Tomcat下的apache-maven-3.6.1\repository\org\apache\logging\log4j\log4j-api\2.10.0路径打开,可以找到log4j-2.10.0.jar
用压缩方式打开不是解压删除module-info.class即可
解决办法二
原因:Tomcat版本底,Spring boot 2.2.1对应的Tomcat版本应该是:tomcat 8.5.16以上将Tomcat版本更新至8.6以上(亲测可用)