Skip to content

WebSocketMessageBrokerConfigurationSupport requiring JDK 7+ due to setRemoveOnCancelPolicy [SPR-12238] #16852

@spring-projects-issues

Description

@spring-projects-issues

zyro opened SPR-12238 and commented

https://github.com/spring-projects/spring-framework/blob/master/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java#L104

calls http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.html#setRemoveOnCancelPolicy-boolean-

which requires JDK 1.7+

example JDK 1.6 stacktrace-snippet:

Caused by BeanDefinitionStoreException:
Factory method [public org.springframework.web.servlet.HandlerMapping org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurationSupport.stompWebSocketHandlerMapping()] threw exception;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageBrokerSockJsTaskScheduler'
defined in class org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration:
Invocation of init method failed; nested exception is 
java.lang.NoSuchMethodError: java.util.concurrent.ScheduledThreadPoolExecutor.setRemoveOnCancelPolicy(Z)V

thanks, zyro


Affects: 4.0.6, 4.0.7, 4.1 GA

Issue Links:

Referenced from: commits 0c680d6, e003d21

Backported to: 4.0.8

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions