Skip to content

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

Closed
@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions