Closed
Description
Ivan Sopov opened SPR-16189 and commented
WebSocketConfigurationSupport.defaultSockJsTaskScheduler() produces TaskScheduler bean and adds it to application context. But if SockJS is not used and not configured - it creates NoOpScheduler that can only throw IllegalStateExceptions. If other component is added to context that requires TaskScheduler it picks that NoOpScheduler and fails with "Unexpected use of scheduler" on it use instead of "No such bean" on creation.
It seems to me that it will be better not to add such NoOpScheduler to application context since it is not usable in any way.
Affects: 5.0.1
Issue Links:
- Support for autowire-candidate with @Bean [SPR-16204] #20752 Support for autowire-candidate with
@Bean
("depends on") - EnableWebSocket registers a non functional task scheduler to the context [SPR-16705] #21246 EnableWebSocket registers a non functional task scheduler to the context ("duplicates")
- Consistent non-exposure of null beans in the BeanFactory API [SPR-17034] #21572 Consistent non-exposure of null beans in the BeanFactory API
- Warn about use of SimpleAsyncTaskExecutor for async requests [SPR-16203] #20751 Warn about use of SimpleAsyncTaskExecutor for async requests
Referenced from: commits 3d6e38b, 6aa6d91
0 votes, 5 watchers