Skip to content
Advertisement

Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class with jetty and log4j 2.9.1?

This is the directory layout I have in my maven project:

JavaScript

pom.xml relavent parts as follows:

JavaScript

And here is my web.xml

JavaScript

and finally this is what log4j.properties look like:

JavaScript

So currently everything runs fine (I start jetty with: mvn jetty:start) and when I visit “/” I see in console:

JavaScript

This is all fine..

JavaScript

after jetty:start I get:

JavaScript

How can I make jetty work with log4j 2.9.1? Is there a problem in my configuration or is this a bug in jetty or log4j?

Advertisement

Answer

log4j 2.9 and later are multi-release jars for Java 9.

Your Jetty version don’t support that. Either upgrade Jetty to a Java 9 compatible version, or use log4j 2.8.x.

See Jetty issue #1797: JEP 238 – Multi-Release JAR files break bytecode scanning.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement