1
votes

I have a spring boot application that works fine on Tomcat 8. When I try to deploy it on Websphere 8.5.5 with "Class loader order" set to "Classes loaded with local class loader first (parent last)" the application fails to start with the following exception:

... 73 more
Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not a subtype
    at java.util.ServiceLoader.fail(ServiceLoader.java:242)
    at java.util.ServiceLoader.access$300(ServiceLoader.java:192)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:380)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:456)
    at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:537)
    at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
    at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
    at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
    ... 74 more
1

1 Answers

1
votes

Just adding my experience with this problem, looking around on the various answers to similar problems I found out that the problem could be caused by some javax-servlet related jar in the classpath. After some trial and error I noticed that the spring-boot-starter-web dependency has an inherited spring-boot-starter-tomcat dependency. Excludung this jar from the application classpath when deploying on Websphere 8.5.5 solved the problem.