导入 XPage 项目的插件不起作用

发布于 2025-01-07 18:14:43 字数 558 浏览 2 评论 0原文

在某些 XPage 应用程序中,我尝试利用作为 Domino 的一部分安装的 org.apache.commons.lang 包。我将其添加到需要部分的plugin.xml 中:

这允许我使用该包,编译代码并成功运行它。我可以将设计刷新到测试数据库,尽管我需要再次添加导入语句,因为设计刷新过程不会更新plugin.xml,但这适用于我的开发服务器(8.5.2 FP3,并且已在 8.5 上运行) .2 FP1 也)。

但是,当我尝试在不同的服务器上运行相同的代码时,它会失败,并出现 org.apache.commons.lang 的 ClassDefNotFoundError。这在许多不同的 Domino 版本和多个数据库上都失败了。如果我清理数据库并重建它,代码可以正常编译,但在运行时仍然会抛出错误。

我的开发服务器的安装跨两个驱动器进行分区,但我不希望将导入添加到plugin.xml 会在幕后的某个位置存储文件路径。

我还尝试将 jar 导入到数据库中并将其作为引用库添加到构建路径中,但再次出现 ClassDefNotFoundError。

任何有关原因或解决方案的想法都将被感激地接受。

In some XPages applications I'm trying to take advantage of org.apache.commons.lang package that is installed as part of Domino. I'm adding it into the plugin.xml in the requires section:

This allows me to use the package, and compiles the code and successfully runs it. I can refresh the design down onto test databases and, although I need to add the import statement in again because the design refresh process does not update the plugin.xml, this works on my development server (8.5.2 FP3 and has worked on 8.5.2 FP1 also).

However, when I try to run the same code on a different server, it fails with a ClassDefNotFoundError for org.apache.commons.lang. This has failed on a number of different Domino versions and multiple databases. If I clean the database and rebuild it, the code compiles fine, but at runtime the error is still thrown.

My development server's install is partitioned across two drives, but I would not expect that adding the import to the plugin.xml would store a filepath somewhere behind the scenes.

I also tried importing the jar into my database and adding it to the build path as a referenced library, but again got the ClassDefNotFoundError.

Any ideas of the cause or resolution would be gratefully accepted.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倾城泪 2025-01-14 18:14:43

远非理想,但我在 WebContent\WEB-INF 下创建了一个名为 lib 的文件夹,并将 jar 文件导入其中。此路径中的 lib 文件夹会自动包含在构建路径中,因此该文件夹中的所有内容都会自动变得可用。经过与其他人交谈,这可能会被另一个 ClassLoader 加载,因此不会与服务器版本冲突。这并不理想,但我知道有几个人正在为这个问题和其他 Apache 库问题寻找更好的解决方案,所以希望这很快就会实现。当有更好的解决方案可用时,我会添加评论。

Far from ideal, but I created a folder under WebContent\WEB-INF called lib and import the jar file into that. The lib folder in this path gets automatically included in the Build Path, so anything in that folder automatically becomes available. After speaking to others, this may get loaded by another ClassLoader, so doesn't conflict with the server version. It's not ideal, but I know of a couple of people working on a better solution for this and other Apache library issues, so hopefully that's coming soon. I'll add a comment when the better solution is available.

愁以何悠 2025-01-14 18:14:43

我的建议是创建一个空的 XSP 库来指定必要的依赖项,然后将其设置为全局库(换句话说,您不必将其显式设置为每个应用程序的依赖项)。这显然有点矫枉过正,但几乎肯定会奏效。

My recommendation would be to create an empty XSP library that specifies the necessary dependency, then set it to be a global library (in other words, you wouldn't have to explicitly set it as a dependency for each application). This is obviously overkill, but it would almost certainly work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文