原因:java.lang.NoClassDefFoundError:orgapachelog4jLogger

原因:java.lang.NoClassDefFoundError:orgapachelog4jLogger,第1张

原因:java.lang.NoClassDefFoundError:org / apache / log4j / Logger

有了@jhadesdev的建议和其他人的解释,我在这里找到了问题。

添加代码以查看各种类加载器可见的内容后,我发现了这一点:

All versions of log4j Logger:   zip:<snip>war/WEB-INF/lib/log4j-1.2.17.jar!/org/apache/log4j/Logger.classAll versions of log4j visible from the classloader of the OAuthAuthorizer class:   zip:<snip>war/WEB-INF/lib/log4j-1.2.17.jar!/org/apache/log4j/Logger.classAll versions of XMLConfigurator:   jar:<snip>com.bea.core.bea.opensaml2_1.0.0.0_6-1-0-0.jar!/org/opensaml/xml/XMLConfigurator.class  zip:<snip>war/WEB-INF/lib/ipp-java-aggcat-v1-devkit-1.0.2.jar!/org/opensaml/xml/XMLConfigurator.class  zip:<snip>war/WEB-INF/lib/xmltooling-1.3.1.jar!/org/opensaml/xml/XMLConfigurator.classAll versions of XMLConfigurator visible from the classloader of the OAuthAuthorizer class:   jar:<snip>com.bea.core.bea.opensaml2_1.0.0.0_6-1-0-0.jar!/org/opensaml/xml/XMLConfigurator.class  zip:<snip>war/WEB-INF/lib/ipp-java-aggcat-v1-devkit-1.0.2.jar!/org/opensaml/xml/XMLConfigurator.class  zip:<snip>war/WEB-INF/lib/xmltooling-1.3.1.jar!/org/opensaml/xml/XMLConfigurator.class

我注意到另一个版本的XMLConfigurator可能会被使用。我对该类进行了反编译,并在第60行找到了该类(该错误在原始堆栈跟踪中)

privatestatic final Logger log =Logger.getLogger(XMLConfigurator.class);
,并且该类是从中导入的
org.apache.log4j.Logger

因此,正是此类被加载和使用。我的解决方法是重命名包含此文件的jar文件,因为我找不到我明确或间接加载它的位置。在我实际部署时可能会造成问题。

感谢您提供的所有帮助以及有关课程加载的急需的课程。



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5010776.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-14
下一篇2022-11-14

发表评论

登录后才能评论

评论列表(0条)

    保存