Spring Boot 2.5.x Multi-module gradle project failed to start in TAP
search cancel

Spring Boot 2.5.x Multi-module gradle project failed to start in TAP

book

Article ID: 297527

calendar_today

Updated On:

Products

VMware Tanzu Application Platform

Issue/Introduction

Customer set $BP_GRADLE_BUILT_ARTIFACT variable at build time as a build env var in Paketo Spring Boot Buildpack on TAP.

Spring Boot 2.5.x Multi-module gradle project failed to start due to exception: 

2023-01-31 10:34:04.718 ERROR 1 --- [           main] org.apache.catalina.core.ContainerBase   : A child container failed during start

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
......
Caused by: java.lang.NullPointerException: null
    at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:382)
    at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:195)
    at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262)
    at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:104)
    at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:83)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    ... 42 common frames omitted



Resolution

It happens because the buildpack symlinks the Spring Cloud Bindings library inside the lib/ folder, and Tomcat can’t handle the symlink. This should be fixed in Spring Boot 2.5.4 which has the patched Tomcat 9 containing the fix. 
As a workaround, customer can set the env var BP_SPRING_CLOUD_BINDINGS_DISABLED to ‘true’ at build time.

- name: BP_SPRING_CLOUD_BINDINGS_DISABLED
  value: true

Customer also has option to try Spring Boot version 2.5.4 for the fix.