且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

意外异常:java.lang.NoClassDefFoundError:org/apache/log4j/LogManager

更新时间:2022-04-10 00:02:30

org.apache.log4j.LogManager 是 log4j 1.2(不是 log4j2)中的一个类.

org.apache.log4j.LogManager is a class from log4j 1.2 (not log4j2).

因此,您的 Web 应用 jar 包之一必须引用它.罪魁祸首应该在堆栈跟踪中可见.

Therefore, one of your web app jars must be referencing it. The culprit should be visible in the stack trace.

根据您的情况,您可能只想向 Web 应用程序添加一个 log4j 1.2 jar,因为这两个版本彼此完全独立.

Depending upon your circumstances, you may want to just add a log4j 1.2 jar to the web app as the two versions are completely independent of each other.