在 Liferay/Glassfish 和 Vaadin 中使用 Quartz 库时出现问题

发布于 2024-10-04 23:06:35 字数 515 浏览 4 评论 0原文

我面临着一个奇怪的问题,要让 Quartz 库在 Glassfish 服务器的 liferay 门户中运行。该应用程序分为两部分,一个基于 Vaadin 的 Web 应用程序将启动/停止quartz 作业,另一个部分包含作业逻辑。

由于作业逻辑部分依赖于作业接口,我必须将 Quartz 部署为 osgi 库。通过这样做,一切正常,我的 Web 应用程序可以看到已安装的作业模块,但在启动作业时,它会出现以下错误。

previously initiated loading for a different type with name "org/quartz/Trigger"

我想这是因为我也在我的 web-inf/lib 中提供了 Quartz 库。但如果我删除它,它会引发 Quartz 依赖项的另一个错误。

我现在唯一可能的解决方案是从具有作业业务逻辑的第二个组件中删除 Quartz 依赖项(而不是实现 org.quartz.Job;创建另一个接口)。

还有其他方法可以解决这个问题吗???

I am facing a weird problem to get the Quartz library run in my liferay portal in Glassfish server. The application is divided into two parts a Vaadin based web app which will start/stop the quartz job and another which contains the jobs logic.

As the job logic part is dependent on the Job interface I have to deploy the Quartz as an osgi library. By doing that everything works fine and my web application can see the installed job module but at the time of starting the job it gives following error.

previously initiated loading for a different type with name "org/quartz/Trigger"

I guess this comes because I have given the Quartz library in my web-inf/lib as well. But if I remove that it throws another error for Quartz dependencies.

The only possible solution I have right now is to remove the Quartz dependencies from the second component which has the job business logic (rather implements org.quartz.Job; create another interface).

Is there any other way to sort this out???

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

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

发布评论

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

评论(1

诗化ㄋ丶相逢 2024-10-11 23:06:35

尝试修复 WAR 文件中的quartz依赖项 - 使用 import-package 并从 WEB-INF/lib 中删除第二个quartz。

还要确保quartz 依赖项实际上是一个包,或者您正在动态包装它。

听起来您由于触发器的多个副本而遇到了类加载问题。错误消息是石英告诉您它是从与以前不同的类加载器加载的触发器。您绝对不希望您的应用程序中存在两个相同版本的 jar。

Trying fixing your quartz dependencies in the WAR file - use import-package and remove the 2nd quartz from WEB-INF/lib.

Also make sure the quartz dependency is actually a bundle or that you are dynamically wrapping it.

It sounds like you have classloading issues due to multiple copies of Trigger. The error message is quartz telling you it's loaded Trigger from a different classloader than previously. You definitely don't want two identical versions of a jar in your app.

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