You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EnableWebSocket registers a non functional task scheduler to the context [SPR-16705] #21246
@EnableWebSocket may register a defaultSockJsTaskScheduler bean that could fallback to NoOpScheduler is no task scheduling is required (sic).
This conflicts with the default behaviour of @EnableScheduling. By default, it will look up for the unique presence of a TaskScheduler and, if one is found, it will use it.
Unfortunately, as soon as those two are in combinations (and @EnableWebSocket runs before @EnableScheduling), it breaks any app as a scheduling task is attempting to register itself to a no op scheduler.
The latter case is unfortunately quite common with Spring Boot as some auto-configurations (i.e. Spring Session Redis) rely on @EnableScheduling and users have @EnableWebSocket on their app to signal they want to use that feature.
Activity
spring-projects-issues commentedon Apr 10, 2018
Artem Bilan commented
I think this SO reports exactly the same issue: https://stackoverflow.com/questions/49742401/spring-websocket-simple-example-java-lang-illegalstateexception-unexpected-us.
At the same time this JIRA might just duplicate an existing one #20737.
Thanks
spring-projects-issues commentedon Apr 10, 2018
Stéphane Nicoll commented
Good catch Artem!