码头警告 - 在多个位置相同 java class

Jetty warning - same java class on multiple locations

我是 运行 使用 Jetty 9.4.12 servlet 容器的 Shibboleth IDP,Jetty 以某种方式警告我:

07:55:31.629 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.Json scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/Json.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/Json.class
07:55:31.634 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonArray scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonArray.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonArray.class
07:55:31.634 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonArrayBuilder scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonArrayBuilder.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonArrayBuilder.class
07:55:31.634 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonBuilderFactory scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonBuilderFactory.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonBuilderFactory.class
07:55:31.634 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonException scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonException.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonException.class
07:55:31.635 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonNumber scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonNumber.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonNumber.class
07:55:31.635 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonObject scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonObject.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonObject.class
07:55:31.635 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonObjectBuilder scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonObjectBuilder.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonObjectBuilder.class
07:55:31.635 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonReader scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonReader.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonReader.class
07:55:31.637 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonReaderFactory scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonReaderFactory.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonReaderFactory.class
07:55:31.637 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonString scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonString.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonString.class
07:55:31.637 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonStructure scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonStructure.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonStructure.class
07:55:31.637 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonValue scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonValue.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonValue.class
07:55:31.638 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonValue scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonValue.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonValue.class
07:55:31.638 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonValue scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonValue.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonValue.class
07:55:31.639 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonValue$ValueType scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonValue$ValueType.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonValue$ValueType.class
07:55:31.640 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonValue scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonValue.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonValue.class
07:55:31.640 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonWriter scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonWriter.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonWriter.class
07:55:31.640 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonWriterFactory scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonWriterFactory.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonWriterFactory.class
07:55:31.641 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.spi.JsonProvider scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/spi/JsonProvider.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/spi/JsonProvider.class
07:55:31.641 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.stream.JsonGenerationException scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/stream/JsonGenerationException.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/stream/JsonGenerationException.class
07:55:31.641 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.stream.JsonGenerator scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/stream/JsonGenerator.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/stream/JsonGenerator.class
07:55:31.641 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.stream.JsonGeneratorFactory scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/stream/JsonGeneratorFactory.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/stream/JsonGeneratorFactory.class
07:55:31.642 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.stream.JsonLocation scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/stream/JsonLocation.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/stream/JsonLocation.class
07:55:31.642 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.stream.JsonParser$Event scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/stream/JsonParser$Event.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/stream/JsonParser$Event.class
07:55:31.642 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.stream.JsonParser scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/stream/JsonParser.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/stream/JsonParser.class
07:55:31.642 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.stream.JsonParserFactory scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/stream/JsonParserFactory.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/stream/JsonParserFactory.class
07:55:31.643 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.stream.JsonParsingException scanned from multiple locations: jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/stream/JsonParsingException.class, jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/stream/JsonParsingException.class

类 似乎用于 javax.json-1.0.4.jar 和 javax.json-api-1.0.jar。知道 Jetty 为什么要警告这些吗?

崩溃了。

  • 07:55:31.635 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] -
    • javax.json.JsonNumber 从多个位置扫描:
    • jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-1.0.4.jar!/javax/json/JsonNumber.class,
    • jar:file:///opt/ps/jetty/jetty-base/tmp/jetty-0.0.0.0-8080-idp.war-_idp-any-8184658660181054677.dir/webinf/WEB-INF/lib/javax.json-api-1.0.jar!/javax/json/JsonNumber.class

这是在对 webapp 启动的注释进行字节码扫描时产生的警告。

同一个 class 的多个版本的存在是错误和不良行为的根源。

在您的情况下,您有两个相同的 class 版本,版本 1.01.0.4 正如 JAR 文件名所见。

由于 ClassLoader 没有 JAR 文件加载顺序预期和要求,因此在不同时间执行相同的 WAR 可能会导致不同的行为。

Jetty 无法确定 classes 重复问题的严重程度,由您决定。 Jetty 只能针对 webapps 中的常见行为问题产生此警告。

要解决此问题,您需要更正生成的 WAR 文件,使其仅包含每个 class.

的 1 个副本