大神你好,
我现在用的1.8.jar,jfinal-ext3.1.2.jar,我想把定时器加进去,但是没有成功,请求帮助,错误内容:
严重: Exception starting filter jfinalubc
java.lang.InstantiationError: org.quartz.JobDetail
at com.jfinal.ext.plugin.quartz.QuartzPlugin.start(QuartzPlugin.java:76)
at com.jfinal.core.Config.startPlugins(Config.java:85)
at com.jfinal.core.Config.configJFinal(Config.java:48)
at com.jfinal.core.JFinal.init(JFinal.java:67)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4809)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5485)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
我现在的定时器死这样配置的:
1,在classpath下增加文件job.properties,其内容是:
#JobA
a.job=job.LoanRecordJob
a.cron=* */3 * * * ?
a.enable=true
然后在配置加载类CommonConfig中,增加如下内容:
ConfigPlugin configPlugin = new ConfigPlugin();
configPlugin.addResource("job.properties");
me.add(new QuartzPlugin());
请求帮助哦,谢谢。