在 Liferay/Glassfish 和 Vaadin 中使用 Quartz 库时出现问题
我面临着一个奇怪的问题,要让 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试修复 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.