Why do grails Quartz jobs die after a few minutes

2019-08-01 10:45发布

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?

2条回答
Anthone
2楼-- · 2019-08-01 11:12

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.

查看更多
啃猪蹄的小仙女
3楼-- · 2019-08-01 11:15

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).

查看更多
登录 后发表回答