简体   繁体   English

ESAPI 2.3.0.0 jar 报告 NoClassDefFound 错误

[英]NoClassDefFound Error reported for ESAPI 2.3.0.0 jar

          There was security scan run on our Project Code and Vulnerability was reported for ESAPI 2.1.0.0 jar. Hence we had to change our code to use ESAPI 2.3.0.0 with zero vulnerabilities. We changed and the code passed the security scan. However, the code is throwing error in Runtime with 

“ java.lang.NoClassDefFoundError: org.owasp.esapi.reference.DefaultValidator (initialization failure)org.owasp.esapi.reference.DefaultValidator (initialization failure)” . “ java.lang.NoClassDefFoundError: org.owasp.esapi.reference.DefaultValidator(初始化失败)org.owasp.esapi.reference.DefaultValidator(初始化失败)”。

The Debug log is as below :调试日志如下:

Text:CHARACTER:java.lang.NoClassDefFoundError: org.owasp.esapi.reference.DefaultValidator (initialization failure)org.owasp.esapi.reference.DefaultValidator (initialization failure) RecoverableException File:CHARACTER:C:\ci\product-build\WMB\src\DataFlowEngine\PluginInterface\jlinklib\com_ibm_broker_plugin_CMbService.cpp Line:INTEGER:1686 Function:CHARACTER:ImbJavaExceptionUtils::throwableToNativeException Severity:INTEGER:3 Number:INTEGER:4395 Text:CHARACTER:Unhandled exception in plugin method Insert Type:INTEGER:5 Text:CHARACTER:java.lang.NoClassDefFoundError Insert Type:INTEGER:5 Text:CHARACTER:java.lang.J9VMInternals Insert Type:INTEGER:5 Text:CHARACTER:initializationAlreadyFailed Insert Type:INTEGER:5 ...文本:CHARACTER:java.lang.NoClassDefFoundError: org.owasp.esapi.reference.DefaultValidator(初始化失败)org.owasp.esapi.reference.DefaultValidator(初始化失败) RecoverableException File:CHARACTER:C:\ci\product-build\ WMB\src\DataFlowEngine\PluginInterface\jlinklib\com_ibm_broker_plugin_CMbService.cpp Line:INTEGER:1686 Function:CHARACTER:ImbJavaExceptionUtils::throwableToNativeException Severity:INTEGER:3 Number:INTEGER:4395 Text:CHARACTER:Unhandled exception in plugin method Insert Type:INTEGER: 5 文本:CHARACTER:java.lang.NoClassDefFoundError 插入类型:INTEGER:5 文本:CHARACTER:java.lang.J9VMInternals 插入类型:INTEGER:5 文本:CHARACTER:initializationAlreadyFailed 插入类型:INTEGER:5 ...

The product used here is IBM ACE v12.0.0.3 and the Java runtime version is 8.这里使用的产品是 IBM ACE v12.0.0.3,Java 运行时版本是 8。

Please help in understanding and resolving above error.请帮助理解和解决上述错误。 We checked the forums and also some of answers written by you and tried them.我们检查了论坛以及您写的一些答案并进行了尝试。 But they are not seeming relevant to issue and hence posting this question over email.但它们似乎与问题无关,因此通过电子邮件发布此问题。

Some of Trials done, but still no success : • Set Classpath variable to right jar file at runtime.一些试验已经完成,但仍然没有成功: • 在运行时将 Classpath 变量设置为正确的 jar 文件。 • Rebuilt using the relevant Jar file. • 使用相关的Jar 文件重建。 • Imported the “DefaultValidator” explicity into code. • 将“DefaultValidator”显式导入代码。

It's hard to tell for certain because you did not provide a full exception stack trace, but generally this problem is almost always caused by misconfiguration of the ESAPI Logger and specifically the ESAPI.Logger property in the ESAPI.properties file.很难确定,因为您没有提供完整的异常堆栈跟踪,但通常这个问题几乎总是由 ESAPI Logger 配置错误引起,特别是ESAPI.properties文件中的ESAPI.Logger属性。

I would refer you to the GitHub discussion item: https://github.com/ESAPI/esapi-java-legacy/discussions/696 or this section in the release notes: https://github.com/ESAPI/esapi-java-legacy/blob/develop/documentation/esapi4java-core-2.2.1.1-release-notes.txt#L39-L78我建议您参考 GitHub 讨论项目: https ://github.com/ESAPI/esapi-java-legacy/discussions/696 或发行说明中的​​此部分: https ://github.com/ESAPI/esapi-java -legacy/blob/develop/documentation/esapi4java-core-2.2.1.1-release-notes.txt#L39-L78

I partly take the blame for this because we more or less noted this in the release notes for ESAPI releases 2.2.1.0 (released on 2020-07-12 and was when this change was first made), 2.2.1.1, 2.2.2.0, 2.2.3.0, and 2.2.3.1 (released 2021-05-07), before I finally removed them in the 2.3.0.0 release.我对此负有部分责任,因为我们或多或少在 ESAPI 版本 2.2.1.0(发布于 2020 年 7 月 12 日并且是首次进行此更改的时间)、2.2.1.1、2.2.2.0 的发行说明中注意到了这一点, 2.2.3.0 和 2.2.3.1(2021-05-07 发布),在我最终在 2.3.0.0 版本中删除它们之前。 I removed them because it became evident from other posts on Stack Overflow, to our GitHub issues, and private emails to the project leaders that developers were never reading those instructions anyway.我删除了它们,因为从 Stack Overflow 上的其他帖子、我们的 GitHub 问题以及发给项目负责人的私人电子邮件中可以明显看出,开发人员从来没有阅读过这些说明。 So, I felt that they were just taking up useless space.所以,我觉得他们只是在占用无用的空间。 That's one reason why I moved it to the Discussion page, but we probably need to put it in an ESAPI FAQ and then get people to look at the FAQ.这就是我将其移至讨论页面的原因之一,但我们可能需要将其放入 ESAPI 常见问题解答中,然后让人们查看常见问题解答。

Regardless, take a look at the links and see if they solve your problem.无论如何,请查看链接,看看它们是否能解决您的问题。 If not, follow up with your email you sent me and I will then answer you there.如果没有,请跟进您发送给我的电子邮件,然后我会在那里回复您。

HTH,高温下,

-kevin -凯文

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM