Log4j 2 – java.lang.NoClassDefFoundError: com/lmax/disruptor/EventTranslatorVararg

Enable the log4j 2 loggers to asynchronous, but hits the following order :


$ mvn -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -jar app.jar

java.lang.NoClassDefFoundError: com/lmax/disruptor/EventTranslatorVararg
    at java.lang.ClassLoader.defineClass1 (Native Method)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:1009)
    at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:174)
    at java.net.URLClassLoader.defineClass (URLClassLoader.java:545)
    at java.net.URLClassLoader.access$100 (URLClassLoader.java:83)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:453)

Solution

To fix it, add disruptor

pom.xml

	<dependency>
		<groupId>com.lmax</groupId>
		<artifactId>disruptor</artifactId>
		<version>3.4.2</version>
	</dependency>

References

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar