$ java -Dlog4j.configuration=file:///path/to/your/log4j2.xml -jar /path/to/your/jar_file.jar
Written to the console, you get
ERROR
In my case I am using the log4j2 Json file log4j2.json in the classpath of my gradle project and I got the same error.
The solution here was to add dependency for JSON handling to my gradle dependencies.
compile group:"com.fasterxml.jackson.core", name:"jackson-core", version:'2.8.4'
compile group:"com.fasterxml.jackson.core", name:"jackson-databind", version:'2.8.4'
compile group:"com.fasterxml.jackson.core", name:"jackson-annotations", version:'2.8.4'
See also documentation of log4j2:
The JSON support uses the Jackson Data Processor to parse the JSON files. These dependencies must be added to a project that wants to use JSON for configuration: