无法启动上下文c.g.g.d.s.j.WebAppContextWithReload [英] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload
问题描述
我不知道如何解决该问题需要帮助.您的帮助将不胜感激.
我刚刚将log4j2 jars(log4j-api-2.10.0.jar,log4j-core-2.10.0.jar)添加到我的Web应用程序中,并且它开始在我的开发人员中遇到这个问题.后来我添加了log4j-web-2.10.0.jar并尝试了,但仍然失败,并显示相同的消息.
这是我的环境:
IDE: Eclipse Oxygen2
JDK: 1.8.0_162
Jetty (embedded in Eclipse): jetty-9.2.z-SNAPSHOT
OS: Win 10 (64bit)
Framework: GWT 2.8.2
堆栈跟踪(部分):
[WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@3a24f397{/,file:<project_path>/war/,STARTING}{<project_path>\war}
MultiException[java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class from jar file:<project_path>/war/WEB-INF/lib/log4j-api-2.10.0.jar, java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class from jar file:<project_path>/war/WEB-INF/lib/log4j-api-2.10.0.jar, java.lang.RuntimeException: Error scanning entry module-info.class from jar file:<project_path>/war/WEB-INF/lib/log4j-api-2.10.0.jar]
at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations(AnnotationConfiguration.java:536)
at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:447)
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:479)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1337)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
.
.
.
Caused by: MultiException[java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class from jar file:<project_path>/WEB-INF/lib/log4j-api-2.10.0.jar, java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class from jar file:<project_path>/WEB-INF/lib/log4j-api-2.10.0.jar, java.lang.RuntimeException: Error scanning entry module-info.class from jar file:<project_path>/WEB-INF/lib/log4j-api-2.10.0.jar]
at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:899)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:831)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:548)
从 https复制://github.com/eclipse/jetty.project/issues/2192 ,(带有其他修改)
这与您使用 JEP-238多次发布JAR 有关. /p>
注意路径..
META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class
META-INF/versions/<java.specification.version>/*
路径前缀告诉您该路径下的类适用于该特定版本的Java,从而替换了顶级JAR中可能相同的命名类.
问题#1797 是首次报告和解决的地方.
它固定用于...
- jetty-9.3.22.v20171030-2017年10月30日
- jetty-9.4.8.v20171121-2017年11月21日
由于Jetty 9.2.x寿命已尽,因此不会有任何支持Jetty 9.2.x上的JEP-238的端口.
您的选择是升级到上面列出的受支持版本之一,或者将log4j的版本降级为不使用JEP-238多发行JAR文件的版本.
还要注意,您正在使用的log4j JEP-238多重发布JAR文件也是Java 9 JPMS模块.
存在module-info.class
表示这一点.
在问题中,Jetty支持忽略字节码扫描期间的module-info.class. #1692
I need help with an issue I have no idea how to resolve. Your help will be greatly appreciated.
I just added log4j2 jars (log4j-api-2.10.0.jar, log4j-core-2.10.0.jar) to my Web app and it started running into this problem in my dev. Later I added log4j-web-2.10.0.jar and tried, it still fails with the same message.
Here's my environment:
IDE: Eclipse Oxygen2
JDK: 1.8.0_162
Jetty (embedded in Eclipse): jetty-9.2.z-SNAPSHOT
OS: Win 10 (64bit)
Framework: GWT 2.8.2
Stack trace (partial):
[WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@3a24f397{/,file:<project_path>/war/,STARTING}{<project_path>\war}
MultiException[java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class from jar file:<project_path>/war/WEB-INF/lib/log4j-api-2.10.0.jar, java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class from jar file:<project_path>/war/WEB-INF/lib/log4j-api-2.10.0.jar, java.lang.RuntimeException: Error scanning entry module-info.class from jar file:<project_path>/war/WEB-INF/lib/log4j-api-2.10.0.jar]
at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations(AnnotationConfiguration.java:536)
at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:447)
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:479)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1337)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
.
.
.
Caused by: MultiException[java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class from jar file:<project_path>/WEB-INF/lib/log4j-api-2.10.0.jar, java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class from jar file:<project_path>/WEB-INF/lib/log4j-api-2.10.0.jar, java.lang.RuntimeException: Error scanning entry module-info.class from jar file:<project_path>/WEB-INF/lib/log4j-api-2.10.0.jar]
at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:899)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:831)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:548)
Copied from https://github.com/eclipse/jetty.project/issues/2192, (with additional edits)
This is related to your use of a JEP-238 Multi-Release JAR.
Notice the path ..
META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class
The META-INF/versions/<java.specification.version>/*
path prefix tells you that the classes below that path are for that specific version of Java, replacing potentially the same named classes in the top level JAR.
Issue #1797 is where this was first reported and fixed.
It was fixed for ...
- jetty-9.3.22.v20171030 - 30 October 2017
- jetty-9.4.8.v20171121 - 21 November 2017
Since Jetty 9.2.x is end of life, there will be no backport to support JEP-238 on Jetty 9.2.x.
Your choices are to upgrade to one of the supported versions listed above, or downgrade your version of log4j to one that does not use JEP-238 Multi-Release JAR Files.
Also of note, the log4j JEP-238 Multi-Release JAR file you are using is also a Java 9 JPMS module.
The presence module-info.class
indicates that.
Support in Jetty to ignore module-info.class during bytecode scanning was fixed in Issue #1692
这篇关于无法启动上下文c.g.g.d.s.j.WebAppContextWithReload的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!