sprin2.5 + quartz scheduler ... org.springframework.beans.factory.BeanCreationException

时间:2013-08-08 12:56:04

标签: java spring quartz-scheduler

我想为我的应用程序使用cron触发器,它有spring2.5

我在创建一个简单的pgm时跟着http://www.a2ztechguide.com/2011/11/spring-quartz-scheduler-integration.html这个链接..但是在尝试将它合成到我的服务器(weblogic 10g)时......我得到了以下异常....

<Aug 8, 2013 6:17:31 PM IST> <Warning> <HTTP> <BEA-101162> <User defined listener
     org.springframework.web.context.ContextLoaderListener failed:
     org.springframework.beans.factory.BeanCreationException: Error creating bean 
  with name 'printCurrentTimeJobDetail' defined in URL [file:/C:/bea/user_projects
 /workspaces/One_CMS_Offline/Services/build/onecms-service.xml]: Initialization of 
bean failed; 
nested exception is java.lang.NoClassDefFoundError: org/quartz/JobDetail     
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 
'printCurrentTimeJobDetail' defined in URL [file:/C:/bea/user_projects/workspaces/One_CMS_Offline/Services/build/onecms-service.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/quartz/JobDetail
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
Truncated. see log file for complete stacktrace
java.lang.NoClassDefFoundError: org/quartz/JobDetail
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.beans.Introspector$1.run(Introspector.java:1272)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
Truncated. see log file for complete stacktrace

有人可以告诉我哪里出错吗?我包括这两个罐子: spring-context-support-2.5.6.jar com.springsource.org.quartz-1.6.2.jar

  

有人可以在这里建议一些解决方案..

2 个答案:

答案 0 :(得分:0)

你必须在你的类路径中包含石英相关的jar,你使用的是哪个版本的石英?

根据您发布的链接,您应该将石英依赖项添加到您的pom.xml

<dependency>
    <groupId>quartz</groupId>
    <artifactId>quartz</artifactId>
    <version>1.5.1</version>
</dependency>

如果您不使用maven,请在类路径中包含quartz.jar,就像使用spring-context-support-2.5.6.jar

一样

- 编辑 -

看起来很奇怪,你在WEB-INF / lib中碰巧没有多个石英副本?什么是com.springsource.org.quartz-1.6.2.jar?尝试从WEB-INF / lib

中排除它

答案 1 :(得分:0)

我不确定您是否也包含石英相关的罐子。

here将最新的石英罐添加到您的服务器/ lib。

由于