Skip to content

SimpleTriggerFactoryBean and CronTriggerFactoryBean fail without jobDetail [SPR-13604] #18182

Closed

Description

@spring-projects-issues

Martin Benda opened SPR-13604 and commented

Factory beans SimpleTriggerFactoryBean and CronTriggerFactoryBean throw NPE when their jobDetail property is not set. This makes it impossible to create triggers without associated job detail (something that we need in our application and that worked fine in Spring 3.x). Moreover, the jobDetail null check in afterPropertiesSet (SimpleTriggerFactoryBean:221) is useless, because jobDetail is dereferenced without any null checking later in this method.

Making it possible to create triggers without job detail will make these bean factories more flexible and should not break any current uses of these beans.


Affects: 3.2.16, 4.2.3

Issue Links:

Referenced from: pull request #896, and commits 2970065, 8adff1b, 67a65ea

Backported to: 3.2.17

Activity

  1. spring-projects-issues commented on Oct 23, 2015

    @spring-projects-issues
    CollaboratorAuthor

    Martin Benda commented

    Pull request URL added.

  2. spring-projects-issues commented on Nov 18, 2015

    @spring-projects-issues
    CollaboratorAuthor

    Martin Benda commented

    Changing "Affects Version/s" to 4.2.3; issue is still present in the latest version.

  3. spring-projects-issues commented on Jan 19, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    As far as I can see, this never worked with Cron/SimpleTriggerFactoryBean... Are you maybe referring to the old Cron/SimpleTriggerBean for Quartz 1.x where this actually worked?

    This is worth fixing in any case. It's just not a regression in those particular classes then.

    Juergen

  4. spring-projects-issues commented on Jan 19, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Stéphane Nicoll commented

    Fixed on master and available in 4.3.0.BUILD-SNAPSHOT in a couple of hours. Juergen Hoeller can you please review and backport to 4.2?

  5. spring-projects-issues commented on Jan 19, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    Sure, will do...

  6. spring-projects-issues commented on Jan 19, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Martin Benda commented

    As far as I can see, this never worked with Cron/SimpleTriggerFactoryBean... Are you maybe referring to the old Cron/SimpleTriggerBean for Quartz 1.x where this actually worked?

    Yes, you are right, I was referring to SimpleTriggerBean from Spring 3.2.8.RELEASE.

    Thanks!

  7. added
    status: backported
    type: enhancement
    on Jan 11, 2019
  8. added this to the 4.2.5 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: backportedtype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions