我正在测试helloworld石英工作。我复制了一个现有的工作并将其粘贴在grails-app / jobs文件夹中。我把它命名为TestJob.groovy。我只是用println消息每分钟开始它。我在cron表达式中犯了一个错误。我删除了这个作业并重新启动了应用程序,我收到以下错误消息。奇怪的是看起来文件仍然存在,因为错误提到错误是在文件TestJob.groovy但我已经删除了这个文件。我尝试清理项目并重建它,我仍然得到错误。感谢您解决此错误并正常重新启动应用程序的任何帮助。谢谢!
| Loading Grails 2.2.0
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Compiling 1 source files.....
| Running Grails application
ERROR context.ContextLoader: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
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)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
... 4 more
Caused by: java.lang.IllegalArgumentException: Cron expression '0 * * * * *' in the job class com.runnercard.RemoveUserCodeJob is not a valid cron expression
at grails.plugins.quartz.config.TriggersConfigBuilder$_prepareCronTriggerAttributes_closure5.doCall(TriggersConfigBuilder.groovy:204)
at grails.plugins.quartz.config.TriggersConfigBuilder$_closure1.doCall(TriggersConfigBuilder.groovy:216)
at grails.plugins.quartz.config.TriggersConfigBuilder.prepareCronTriggerAttributes(TriggersConfigBuilder.groovy:198)
at grails.plugins.quartz.config.TriggersConfigBuilder.createTrigger(TriggersConfigBuilder.groovy:78)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:251)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:244)
at com.runnercard.RemoveUserCodeJob$__clinit__closure1.doCall(TestJob.groovy:14)
at grails.plugins.quartz.config.TriggersConfigBuilder.build(TriggersConfigBuilder.groovy:51)
at grails.plugins.quartz.DefaultGrailsJobClass.evaluateTriggers(DefaultGrailsJobClass.java:57)
at grails.plugins.quartz.DefaultGrailsJobClass.<init>(DefaultGrailsJobClass.java:47)
... 4 more
ERROR context.GrailsContextLoader: Error initializing the application: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
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)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
... 4 more
Caused by: java.lang.IllegalArgumentException: Cron expression '0 * * * * *' in the job class com.runnercard.RemoveUserCodeJob is not a valid cron expression
at grails.plugins.quartz.config.TriggersConfigBuilder$_prepareCronTriggerAttributes_closure5.doCall(TriggersConfigBuilder.groovy:204)
at grails.plugins.quartz.config.TriggersConfigBuilder$_closure1.doCall(TriggersConfigBuilder.groovy:216)
at grails.plugins.quartz.config.TriggersConfigBuilder.prepareCronTriggerAttributes(TriggersConfigBuilder.groovy:198)
at grails.plugins.quartz.config.TriggersConfigBuilder.createTrigger(TriggersConfigBuilder.groovy:78)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:251)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:244)
at com.runnercard.RemoveUserCodeJob$__clinit__closure1.doCall(TestJob.groovy:14)
at grails.plugins.quartz.config.TriggersConfigBuilder.build(TriggersConfigBuilder.groovy:51)
at grails.plugins.quartz.DefaultGrailsJobClass.evaluateTriggers(DefaultGrailsJobClass.java:57)
at grails.plugins.quartz.DefaultGrailsJobClass.<init>(DefaultGrailsJobClass.java:47)
... 4 more
答案 0 :(得分:0)
做一个grails clean并清除.slcache做了。也许缓存是罪魁祸首。