如何使用 Tomcat 应用程序中嵌入的 jython 动态添加 jar?

发布于 2024-07-06 05:59:28 字数 269 浏览 4 评论 0原文

我想让我的应用程序(应用程序容器)(应用程序包含子应用程序)的用户将 java jar 添加到他们的 jython 路径中。

我让子应用程序管理器在 jython 中编写自己的扩展,但他们想要添加的一些功能需要额外的 jar。 例如,如果他们想检查 svn 存储库,他们需要 svn 访问 jar,我不想将其复制到 /WEB-INF/lib,而是复制到 /subapps/appX/lib。

虽然我可以向 sys.path 添加类目录结构,但似乎无法添加 jar。 是否可以?

I want to let the users of my app, which is in turn an app container (app contains subapps), add java jars to their jython path.

I let the subapp managers write thir own extensions in jython, but some of the functionality they want to add needs additional jars. For example, if they want to check a svn repo, they need the svn access jars, which I would rather not copy to /WEB-INF/lib, but rather to /subapps/appX/lib.

While I can add a class directory structure to sys.path, it seems that I can't add a jar. Is it possible?

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

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

发布评论

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

评论(1

誰認得朕 2024-07-13 05:59:28

这很有趣。 它在命令行中不起作用,但在从 tomcat 尝试时却可以。 缓存可能会有延迟吗?

在命令行中,如果我尝试不存在的导入,缓存管理器会显示为新添加的 jar 找到的新包。 然后然后它就起作用了。

It is funny. It did not work from the command line, but it does when trying from tomcat. Might there be a delay in caching or so?

In the command line, if I try a non-existant import, the cache manager shows the new package found for the newly added jar. And then it works.

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