|
Workaround, change QuartzConfig.groovy as follows: import grails.util.Environment quartz { btw. an error occurs when i am running the command grails install-quartz-config Running script C:\Dokumente und Einstellungen\zadkh\.grails\1.1.1\projects\grails111-test\plugins\quartz-0.3.3\scripts\InstallQuartzConfig.groovy Error executing script InstallQuartzConfig: null\scripts\Init.groovy (Das System kann den angegebenen Pfad nicht finden) java.io.FileNotFoundException: null\scripts\Init.groovy (Das System kann den angegebenen Pfad nicht finden) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at gant.Gant$_closure1.doCall(Gant.groovy:120) at gant.Gant$_closure1.call(Gant.groovy) at InstallQuartzConfig.run(InstallQuartzConfig:26) at InstallQuartzConfig$run.call(Unknown Source) at gant.Gant.processTargets(Gant.groovy:494) at gant.Gant.processTargets(Gant.groovy:480) Helmut, that is another issue The workaround seems to fix the problem for me too. But I have a problem with this workaround: I now have an integration test that ends up in an infinite loop. This test triggers a Quartz job (with quartzScheduler.triggerJob()) and waits until it finishes to check that the job has been doing what it is supposed to do (send an email). As the configuration option simply tells Quartz to automatically start job scheduling on app startup starting job scheduling in that specific integration test should solve this problem. At the moment, I don't know exactly how to do this. However, QuartzBootStrap.groovy should serve pretty well as a guideline.
Sergey Nebolsin made changes - 22/Jun/09 08:16 AM
Changed the DefaultQuartzConfig.groovy file to have 'autoStartup = false' for test environment.
Sergey Nebolsin made changes - 22/Jun/09 08:53 AM
Am I right in saying that this fix does not solve my problem, ie testing Quartz jobs in integration tests? You could turn quartzScheduler on for this specific test by injecting Quartz sheduler ('def quartzSheduler') and using quartzScheduler.start(). Ok, I found
Sergey Nebolsin made changes - 23/Jun/09 08:48 AM
Thanks Sergey, your solution worked fine for my problem. I had the same issue but fixed it differently. The problem seemed to be with getting the ApplicationContext, so I used dependency injection instead for the 'quartzScheduler' bean: class QuartzBootStrap {
def quartzScheduler
def init = {servletContext ->
if (ConfigurationHolder.config?.quartz?.autoStartup) quartzScheduler.start()
}
def destroy = {}
}
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I created a new 1.1.1 app and only installed the quartz plugin in order to duplicate the issue. Ran grails test-app and received same stack trace. Hope that helps.