问题描述
我的BootStrap.groovy(Grails 2.5.6)说:
AutoKbartUrlUpdateJob.schedule(grailsApplication.config.ygor.autoUpdateJobsInterval,params)
和IDEA IntelliJ绝对可以,执行作业没有任何问题。但是当部署到Tomcat服务器上时,Tomcat无法启动,并说:
groovy.lang.MissingMethodException: No signature of method: static ygor.AutoKbartUrlUpdateJob.schedule() is applicable for argument types: (java.lang.String,java.util.HashMap)
我正在使用grails石英插件:
compile "org.grails.plugins:quartz:1.0.2"
QuartzGrailsPlugin.groovy使用以下方法为Job类添加接收方法(仅在IntelliJ中工作)
// Schedule with job with cron trigger
mc.'static'.schedule = { String cronExpression,Map params = null ->
scheduleTrigger(TriggerUtils.buildcrontrigger(jobName,jobGroup,cronExpression),params)
}
如何解决此问题,使其在IntelliJ和Tomcat上都能正常工作?我找不到使用搜索引擎的信息。
如果两个版本都不适用,那么我会使用其他版本,因此仅Tomcat的解决方案也会对我有帮助。
解决方法
一个瞎子。我缺少提交在版本管理(git)中添加到BuildConfig.groovy的grails插件。