Skip to content

DefaultManagedTaskScheduler created manually now throws a NPE if the scheduled executor is not configured #31751

@fullopt

Description

@fullopt

After upgrading from 3.1.5 to 3.2.0 my application fails:

org.springframework.context.ApplicationContextException: Failed to start bean 'simpleBrokerMessageHandler'

The reason:

Caused by: java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)" because "this.scheduledExecutor" is null
        at org.springframework.scheduling.concurrent.ConcurrentTaskScheduler.scheduleWithFixedDelay(ConcurrentTaskScheduler.java:262) ~[spring-context-6.1.1.jar:6.1.1]
        at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.startInternal(SimpleBrokerMessageHandler.java:271) ~[spring-messaging-6.1.1.jar:6.1.1]
        at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.start(AbstractBrokerMessageHandler.java:210) ~[spring-messaging-6.1.1.jar:6.1.1]
        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:284) ~[spring-context-6.1.1.jar:6.1.1]

Can you please help me to fix it?

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions