[英]Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/ProvisionNode
I'm running some very old legacy code, which has worked in the past.我正在运行一些非常古老的遗留代码,这些代码过去一直有效。 This time, it's giving me the following error这一次,它给了我以下错误
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/ProvisionNode
The line that causes the error is导致错误的行是
public static org.apache.log4j.Logger getLogger(java.lang.String name) { /* compiled code */ }
in the Logger class defined by log4j.在 log4j 定义的 Logger 类中。 I have log4j 1.2.17 included in the code, which is the most up-to-date version according to maven .我在代码中包含 log4j 1.2.17,这是根据maven的最新版本。
Has anyone else seen this error?有没有其他人看到这个错误? Any idea what it could be?知道它可能是什么吗? Thanks!!谢谢!!
Please note this problem has now been solved, the solution accepted below solves the problem.请注意这个问题现在已经解决了,下面接受的解决方案解决了这个问题。 This is a specific issue with the ProvisionNode
class, which is found in only certain log4j libraries.这是ProvisionNode
类的一个特定问题,该类仅存在于某些 log4j 库中。 It should be left here and NOT marked as duplicate for others who encounter the same problem.对于遇到相同问题的其他人,它应该留在这里并且不标记为重复。
在我的情况下,我忘记从我的 Maven 依赖项中删除<provided>
标记,所以它在本地机器上找不到任何东西
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.