ServerEndpointExporter causes refresh to fail with java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available [SPR-12340] #16945
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
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: