这是我的applicationContext.xml
<bean id="studentbean" class="com.Student">
<property name="name" value=" " />
</bean>
<bean id="JobA" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.Student" />
<property name="jobDataAsMap">
<map>
<entry key="timeout" value="5" />
</map>
</property>
</bean>
<bean id="cronTriggerJobA" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="JobA" />
<property name="cronExpression" value="0/5 * * * * ?" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="jobDetails">
<list>
<ref bean="JobA" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="cronTriggerJobA" />
</list>
</property>
</bean>
我正在使用spring-2.5.6.jar和quartz-1.8.5.jar 执行时我收到错误
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.quartz.impl.StdSchedulerFactory]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
我能够在没有弹簧集成的情况下使用Quartz调度程序,但现在我遇到了这个错误,任何人都有这个解决方案
答案 0 :(得分:0)
谢谢它的工作,org / slf4j / LoggerFactory在jar中没有我添加的内容