spring-framework: Error running the application as WAR in tomcat 9 [SPR-17599]

Teh Kok How opened SPR-17599 and commented

#16725 is closed but it happens on Tomcat 9. The suggested code snippet does not work as it gives similar exception:  | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'endpointExporterInitializer' defined in class path resource [com/graphql/book/AppConfig.class]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available|   https://github.com/eh3rrera/graphql-java-spring-boot-example/issues/10 https://github.com/graphql-java-kickstart/graphql-spring-boot/issues/165   Response I get from users@tomcat.apache.org:   "Spring is throwing the exception. Tomcat ships with the javax.websocket.server.ServerContainer class.

I don’t believe there are any differences between Tomcat 8.5.x and 9.0.x when it comes to ClassLoader layout and class visibility.

I’d ask Spring how they are performing that sanity check to see why they are throwing that exception."


Affects: 5.1.3

Issue Links:

  • #16725 ServerEndpointExporter causes application context refresh to fail with an NPE when used in a Spring Boot app

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 36 (13 by maintainers)

Most upvoted comments

@khteh That is what I would expect. The problem is occurring in Spring Framework due to the change in Tomcat 9.0.13.

A fix in Tomcat has been committed. It will be available in 9.0.31, 8.5.51, and 7.0.100.

I do want to clarify this affects more than Tomcat 9 it also affects latest Tomcat 8