Jörg Brenninkmeyer
Jörg Brenninkmeyer

Reputation: 3344

Why do grails Quartz jobs die after a few minutes on production?

Using the grails Quartz plugin (latest stable version, 0.4.2), I have four different Jobs that run fine in my development environment, most of them every minute.

However in the production environment, they run for a few minutes and then "die" - they just don't run anymore. There is no Exception thrown or similar. The rest of the application still works fine.

Does anybody have an idea what the reason for this could be? Where / How should I start analyzing the problem?

Upvotes: 1

Views: 1154

Answers (2)

ataylor
ataylor

Reputation: 66059

I also ran into an issue with quartz-1.5.2.jar being used instead of the quartz-1.7.3.jar included in the quartz plugin. I traced it to a dependency in shiro, which itself includes a shiro-quartz.jar that itself has a dependency on that exact version of quartz.

My solution was to add this to my BuildConfig.groovy:

grails.project.dependency.resolution = {

    ...

    dependencies {
        compile("org.apache.shiro:shiro-quartz:1.0.0-incubating") {
            excludes("quartz")
        }
    }
}

If it's not shiro, try running grails dependency-report. From there you can find out what is pulling in the wrong version of quartz.

Upvotes: 2

Jörg Brenninkmeyer
Jörg Brenninkmeyer

Reputation: 3344

I think I found the problem based on this grails JIRA comment.

Somehow the quartz-1.5.2.jar was on my production environment, in addition to quartz-1.7.3.jar. I've removed it and after restarting Tomcat, it's been working (at least until now).

Upvotes: 1

Related Questions