-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
ServerEndpointExporter causes refresh to fail with java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available [SPR-12340] #16945
Comments
Juergen Hoeller commented So the problem with Boot is not just that the Anyway, we'll be able to deal with it through extra checks and multiple invocation paths to Juergen |
Andy Wilkinson commented One further inspection, it's more subtle than my description above. The ordering of
I realise now that this works, not because it's |
Juergen Hoeller commented Alright, thanks for the in-depth analysis, Andy - that helps a lot. I'll figure out how to deal with it :-) Juergen |
Juergen Hoeller commented This is coming up in the next 4.1.2 snapshot now. I'll backport it to 4.0.8 later this week. Juergen |
Andy Wilkinson commented Thanks, Juergen. I've tested a 4.1.2 snapshot with a small Boot app that uses |
Teh Kok How commented I am using Spring Boot 2.1.0.RELEASE with Java 11 and Tomcat 9 deploying WAR into tomcat webapp and still see the same error. I added the workaround code snippet suggested but doesn't help. |
Andy Wilkinson opened SPR-12340 and commented
This is the same problem as #16725 but the symptom's changed. Sorry for not testing the fix when it was made in 4.0.7.
The failure's now an IllegalStateException:
The reason is still largely the same. In initApplicationContext, ServerEndpointExporter assumes that the ServletContext will be available on the WebApplicationContext. This isn't true in Spring Boot and leaves ServerEndpointExporter without a ServerContainer.
AFAICT, ServerEndpointExporter needs to defer its use of the ServletContext until ServletContextAware processing.
Affects: 4.0.7, 4.1.1
Issue Links:
Referenced from: commits 7507560, 10328f1
Backported to: 4.0.8
The text was updated successfully, but these errors were encountered: