将插件导入 XPage 项目不起作用 [英] Imported plugin into XPages Project not working

查看:28
本文介绍了将插件导入 XPage 项目不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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:

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

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).

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

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.

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

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.

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

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.

推荐答案

远非理想,但我在 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.

这篇关于将插件导入 XPage 项目不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆