我使用的是Spring-Version:2.0.7,我需要下載石英庫和它們的依賴來使用它嗎?因爲起初我雖然需要它,但它給了我一個java.lang.IncompatibleClassChangeError。Spring-Version:2.0.7集成石英?
所以我想,也許它被集成在spring.jar中,因爲根據2.5 spring會在spring庫中調用應用程序上下文。
如何當我刪除quarta.jar,我無法訪問JobExecutionContext類。這裏是我的bean聲明:
<bean name="exampleJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.bamboo.common.util.CheckAndProcessFilesJob" />
<property name="jobDataAsMap">
<map>
<entry key="timeout" value="5" />
</map>
</property>
</bean>
Java代碼
package com.bamboo.common.util;
import org.springframework.scheduling.quartz.QuartzJobBean;
/**
* Created by IntelliJ IDEA.
* User: ernestobuttolazio
* Date: 19-may-2011
* Time: 16:44:54
* To change this template use File | Settings | File Templates.
*/
public class CheckAndProcessFilesJob extends QuartzJobBean {
private int timeout;
private int contador;
/**
* Setter called after the ExampleJob is instantiated
* with the value from the JobDetailBean (5)
*/
public void setTimeout(int timeout) {
this.timeout = timeout;
}
protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {
// do the actual work
contador += timeout;
}
}
您嘗試使用哪個版本的Quartz? – 2011-05-19 21:29:35