1

突然,当尝试将外部库(jar)从磁盘添加到我的数据库时,运行代理时出现 NoClassDefFoundError。
这在以前没有任何麻烦。

[0A04:001B-13BC] 2014-01-21 11:24:57   AMgr: Start executing agent 'areadregis' in 'kunder\lf\emir.nsf'
[0A04:001E-0F38] 2014-01-21 11:24:57   Agent Manager: Agent  error: Exception in thread "AgentThread: readRegis"
[0A04:001F-0F38] 2014-01-21 11:24:57   Agent Manager: Agent  error: java.lang.NoClassDefFoundError: org.apache.commons.i
o.FileUtils

参考这个线程https://stackoverflow.com/questions/14464827/are-jar-files-in-webcontent-web-inf-lib-available-to-java-design-elements-in-dom 我已经尝试了所有提示,但仍然失败。

我的代码在引用库时出错,并建议我将其添加到构建路径。问题是它已经在我的构建路径中。

如果我将 jar 文件添加到 WebContent/WEB-INF/lib/ 并右键单击并添加到 Build Path,它会向上移动到 Referenced Libraries。
Java 代理编译时没有错误或警告,但在运行时会停止并出现其他错误:

[19D8:01CB-17D8] 2014-01-21 11:13:25   Agent Manager: Agent  error: Exception in thread "Launcher: readRegis"
[19D8:01CC-17D8] 2014-01-21 11:13:25   Agent Manager: Agent  error: java.lang.Error: Unresolved compilation problems:
The import org.apache.commons.io cannot be resolved     FileUtils cannot be resolved

运行 Domino 9.0.1 Win/64

请指教

4

2 回答 2

2

据我所知,您不能在 Java 代理中使用 WebContent\WEB-INF 中的 jar 文件。从那个位置,它只能被用于 XPages 等的 Java 类访问。

如果您将它直接添加到代理或脚本库,它应该可以工作。

于 2014-01-21T10:50:40.953 回答
1

我有同样的问题。就我而言,这是因为我在代理和库中有不同版本的 Java 编译器。

于 2015-02-17T13:34:01.633 回答