I recently upgraded to Spring Boot 2, our app is deployed out through Bamboo onto PCF the build runs fine however during the deployment stage I receive the following error:
java.lang.ClassNotFoundException: org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
We aren't using the EmbeddedServletContainerCustomizer
class anywhere in the code and I can't figure out where this is coming from. Wondering if this is a pom issue?
I have tried all other questions on here of a similar nature.
org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
was removed from spring-boot
dependency in 2.X. Most likely you haven't updated the dependencies fully and there is a dependency that refers to spring-boot-1.X
somewhere in your build.
The fact that it works on Bamboo implies that your CI is polluted and doesn't reflect the deployment environment.
This issue turned out to be caused by our packaging of the spring app into a war which requires implementing the SpringBootServletInitializer
class to override the configure method:
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(WebApplication.class);
}
This in turn was throwing the above error. Taking steps now to remove this and package our app as a jar instead!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With