码头警告-多个位置上的同一Java类

时间:2018-10-08 08:30:19

标签: java-8 jetty shibboleth jetty-9

我正在使用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$1 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$1.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$1.class
07:55:31.638 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonValue$2 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$2.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$2.class
07:55:31.638 - WARN [org.eclipse.jetty.annotations.AnnotationParser:569] - javax.json.JsonValue$3 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$3.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$3.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要警告这些吗?

1 个答案:

答案 0 :(得分:0)

崩溃了。

  • 07:55:31.635-警告[org.eclipse.jetty.annotations.AnnotationParser:569]-
    • 从多个位置扫描的javax.json.JsonNumber:
    • jar:文件:///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:文件:///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启动注释生成的警告。

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

对于您的情况,从JAR文件名可以看到,您有2个版本的同一类,分别为1.01.0.4

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

Jetty无法确定重复类的严重性,这取决于您自己决定。对于网络应用中的常见行为问题,Jetty只能发出此警告。

要解决此问题,您需要更正生成的WAR文件,使其仅包含每个类的1个副本。