严重:无法处理Tomcat 7 && Java 8中的Jar条目[module-info.class]

时间:2018-10-30 11:28:41

标签: java maven tomcat java-8 tomcat7

我在 tomcat 7,java 8 && Eclipse中部署了战争文件 版本:Luna Service Release 1(4.4.1)

运行时显示以下错误。

信息:validateJarFile(D:\ EclipseWorkspace.metadata.plugins \ org.eclipse.wst.server.core \ tmp0 \ wtpwebapps \ administration \ WEB-INF \ lib \ javax.el-api-3.0.0.jar) -未加载jar。参见Servlet Spec 3.0,第10.7.2节。令人反感的类:javax / el / Expression.class 2018年10月30日4:03:19 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar 严重:无法处理Jar [jar:file:/ D:/AdminUiAngularEclipseWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/code-connect中的Jar条目[module-info.class] -administration / WEB-INF / lib / yasson-1.0.jar!/]进行注释 org.apache.tomcat.util.bcel.classfile.ClassFormatException:常量池中的无效字节标记:19     在org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:136)     在org.apache.tomcat.util.bcel.classfile.ConstantPool。(ConstantPool.java:59)     在org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:208)     在org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:118)     在org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2058)     在org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1934)     在org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1900)     在org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)     在org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1317)     在org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)     在org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)     在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)     在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)     在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5378)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1575)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1565)     在java.util.concurrent.FutureTask.run(FutureTask.java:266)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在java.lang.Thread.run(Thread.java:745)

2018年10月30日下午4:03:19 org.apache.catalina.startup.ContextConfig进程注释 严重:无法处理Jar [jar:file:/ D:/AdminUiAngularEclipseWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/code-connect中的Jar条目[module-info.class] -administration / WEB-INF / lib / javax.json-1.1.jar!/]作注释 org.apache.tomcat.util.bcel.classfile.ClassFormatException:常量池中的无效字节标记:19     在org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:136)     在org.apache.tomcat.util.bcel.classfile.ConstantPool。(ConstantPool.java:59)     在org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:208)     在org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:118)     在org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2058)     在org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1934)     在org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1900)     在org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)     在org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1317)     在org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)     在org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)     在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)     在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)     在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5378)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1575)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1565)     在java.util.concurrent.FutureTask.run(FutureTask.java:266)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在java.lang.Thread.run(Thread.java:745)

2018年10月30日下午4:03:20 org.apache.catalina.startup.ContextConfig processAnnotationsJar 严重:无法处理Jar [jar:file:/ D:/AdminUiAngularEclipseWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/code-connect中的Jar条目[module-info.class] -administration / WEB-INF / lib / javax.json.bind-api-1.0.jar!/]作注释 org.apache.tomcat.util.bcel.classfile.ClassFormatException:常量池中的无效字节标记:19     在org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:136)     在org.apache.tomcat.util.bcel.classfile.ConstantPool。(ConstantPool.java:59)     在org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:208)     在org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:118)     在org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2058)     在org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1934)     在org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1900)     在org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)     在org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1317)     在org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)     在org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)     在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)     在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)     在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5378)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1575)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1565)     在java.util.concurrent.FutureTask.run(FutureTask.java:266)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在java.lang.Thread.run(Thread.java:745)

2018年10月30日下午4:03:20 org.apache.catalina.startup.ContextConfig processAnnotationsJar 严重:无法处理Jar [jar:file:/ D:/AdminUiAngularEclipseWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/code-connect中的Jar条目[module-info.class] -administration / WEB-INF / lib / javax.json-api-1.1.jar!/]作注释 org.apache.tomcat.util.bcel.classfile.ClassFormatException:常量池中的无效字节标记:19     在org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:136)     在org.apache.tomcat.util.bcel.classfile.ConstantPool。(ConstantPool.java:59)     在org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:208)     在org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:118)     在org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2058)     在org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1934)     在org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1900)     在org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)     在org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1317)     在org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)     在org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)     在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)     在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)     在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5378)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1575)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1565)     在java.util.concurrent.FutureTask.run(FutureTask.java:266)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在java.lang.Thread.run(Thread.java:745)

请帮忙。

1 个答案:

答案 0 :(得分:0)

尝试升级TomCat的版本。这是fixed的位置:

- trunk for 9.0.0.M18 onwards
- 8.5.x for 8.5.12 onwards
- 8.0.x for 8.0.42 onwards
- 7.0.x for 7.0.76 onwards

它不起作用的原因是因为您在旧的TomCat版本中使用了模块化(带有module-info.class文件)依赖项。 TomCat(bcel库)试图扫描类文件,试图找到诸如@WebServlet之类的注释,但遇到未知的字节码。

如果使用org.apache.tomcat.maven:tomcat7-maven-plugin启动嵌入式TomCat,则可以遵循此instruction