我正在开发一个利用quartz插件的grails项目。该插件按预期工作,无需在开发模式下本地运行项目。但是,在一个独立的tomcat实例中运行项目时,我收到以下错误。
Error initializing Grails: 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.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
... 1 more
Caused by: java.lang.reflect.InvocationTargetException
... 1 more
Caused by: java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at grails.plugins.quartz.config.TriggersConfigBuilder.createTrigger(TriggersConfigBuilder.groovy:77)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:251)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:244)
at org.motus.CompetitionJob$__clinit__closure10.doCall(CompetitionJob.groovy:18)
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)
... 1 more
以下是我在BuildConfig.groovy中的内容
compile ":quartz:1.0.1"
任何有关如何补救的想法或方向都将受到最高的赞赏。在此先感谢您的帮助。
答案 0 :(得分:3)
我也在使用Apache Shiro插件,结果显示需要排除石英依赖。感谢Lalit的链接
compile ":quartz:1.0.1"
compile (":shiro:1.2.1"){
excludes "quartz"
}