Quartz - ClassCastException [英] Quartz - ClassCastException

查看:210
本文介绍了Quartz - ClassCastException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Jboss5.1.x,EJB3.0
我正在尝试配置Quartz。
当我尝试查找时,我得到这个异常:

  InitialContext ctx = new InitialContext(); 
StdScheduler scheduler =(StdScheduler)ctx.lookup(Quartz);

这是例外:


java.lang.ClassCastException:无法将org.quartz.impl.StdScheduler转换为org.quartz.Scheduler


任何人有任何想法?



谢谢。

解决方案

可能在您的类路径中有两个Quartz JAR副本 - JBoss有自己的副本,您的应用程序在其 lib 目录中也可能有一个。两人正在冲突。



从应用程序中删除JAR,然后重试。


I am using Jboss5.1.x , EJB3.0 I am trying to configure Quartz. I get this exception when I try to do lookup:

       InitialContext ctx = new InitialContext();
        StdScheduler scheduler = (StdScheduler) ctx.lookup("Quartz");

this is the exception:

java.lang.ClassCastException: org.quartz.impl.StdScheduler cannot be cast to org.quartz.Scheduler

anyone has any idea?

Thanks.

解决方案

You most likely have two copies of the Quartz JAR in your classpath - JBoss has its own copy, and your application probably has one too, in its lib directory. The two are clashing.

Remove the JAR from your application and try again.

这篇关于Quartz - ClassCastException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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