Log4j 2 java.lang.NoClassDefFoundError: com/lmax/disruptor/EventTranslatorVararg
By:Roy.LiuLast updated:2019-08-11
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>
Note
Read this Making All Loggers Asynchronous
Read this Making All Loggers Asynchronous
From:一号门
COMMENTS