Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Sep 23, 2014 · 5 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Sep 23, 2014

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

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 23, 2014

zyro commented

change was introduced by #16537 and the referenced commits/prs

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Tomcat and Jetty each require JDK 1.7 for their WebSocket support and so does JSR-356. Can you elaborate how you run into this?

@spring-projects-issues
Copy link
Collaborator Author

zyro commented

zyro23/grails-spring-websocket#13 (comment)

i guess a user tried to use the grails plugin with jdk 1.6 resulting in the app not even starting...

i am unsure how to handle this, too. i have no problem at all marking that grails plugin as "only jdk 1.7+ compatible and if you try 1.6 expect a crash" - however that would not be very "user-friendly" although trying to use it with 1.6 makes just no sense...

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I wasn't expecting anyone to run this on JDK 6 either. That said, it should be easy enough to simply conditionally call that setRemoveOnCancelPolicy method.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 24, 2014

Chandan commented

Has this been tested for IBM provided Java (version java_1.7_64). in container Web Sphere. I recently upgraded to 4.1.2 for pulling fix for #16888, but the the upgrade breaks due to exception in WebSphere. Asked here as well: http://stackoverflow.com/questions/27107825/spring-build-4-1-2-is-throwing-error-about-missing-method-setremoveoncancelpolic. Following is the stack trace

org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler org.springframework.web.socket.config.annotation.WebSocketConfigurationSupport.defaultSockJsTaskScheduler()] threw exception; nested exception is java.lang.NoSuchMethodError: org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.setRemoveOnCancelPolicy(Z)V
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1025)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:921)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.jav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants