我在grails項目中安裝了Quartz插件,但是當我編譯時,它給了我下面的錯誤。Grails上的石英插件錯誤
Error loading plugin manager: startup failed:
C:\Users\X\.grails\1.3.7\projects\Val\plugins\quartz-0.4.2\QuartzGrailsPlugin.groovy: 116: You cannot create an instance from the abstract interface 'org.quartz.CronTrigger'.
@ line 116, column 35.
Trigger trigger = new CronTrigger(generateTriggerName(), GTCP.DEFAULT_TRIGGERS_GROUP, jobName, jobGroup, cronExpression)
^
C:\Users\X\.grails\1.3.7\projects\Val\plugins\quartz-0.4.2\QuartzGrailsPlugin.groovy: 122: You cannot create an instance from the abstract interface 'org.quartz.SimpleTrigger'.
@ line 122, column 35.
Trigger trigger = new SimpleTrigger(generateTriggerName(), GTCP.DEFAULT_TRIGGERS_GROUP, jobName, jobGroup, new Date(), null, repeatCount, interval)
^
C:\Users\X\.grails\1.3.7\projects\Val\plugins\quartz-0.4.2\QuartzGrailsPlugin.groovy: 128: You cannot create an instance from the abstract interface 'org.quartz.SimpleTrigger'.
@ line 128, column 35.
Trigger trigger = new SimpleTrigger(generateTriggerName(), GTCP.DEFAULT_TRIGGERS_GROUP, jobName, jobGroup, scheduleDate, null, 0, 0)
^
C:\Users\X\.grails\1.3.7\projects\Val\plugins\quartz-0.4.2\QuartzGrailsPlugin.groovy: 133: You cannot create an instance from the abstract interface 'org.quartz.SimpleTrigger'.
@ line 133, column 35.
Trigger trigger = new SimpleTrigger(generateTriggerName(), GTCP.DEFAULT_TRIGGERS_GROUP, jobName, jobGroup, scheduleDate, null, 0, 0)
^
4 errors
,這就是我想實現...
class MyJob {
static triggers = {
cron name: 'myTrigger', cronExpression: "0 0 6 * * ?"
}
def group = "MyGroup"
def execute(){
print "Job run!"
}
}
注:插件版本是0.4.2
我認爲你需要添加更多的細節(比如你使用的是什麼版本的grails)。我最近安裝並使用了這個插件,它運行得非常完美。你在哪裏有MyJob課程?這應該使用> grails create-job MyJob創建,對不起,我不能提供太多幫助。 – ibaralf 2012-01-04 21:15:05
感謝您回覆@ibaralf。我使用了下面的命令。 grails create-job MyJob,但在此之前發佈了grails install-plugin quartz命令。我使用的是Grails 1.3.7,MyJob是在grails-app/jobs/val/ – supp 2012-01-05 09:50:52