Java Buildpack is not installing Tomcat inside the app
search cancel

Java Buildpack is not installing Tomcat inside the app

book

Article ID: 298056

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

Java Buildpack is not installing Tomcat inside the app even though JBP_CONFIG_TOMCAT is present. As show in below images manifest has configured Tomcat details, but when staging it's not pulling Tomcat into the final app executable.



Environment

Product Version: 2.8

Resolution

As described in doc the detection criterion of deploying Tomcat into app droplet is:

"Existence of a WEB-INF/ folder in the application directory and Java Main not detected"

Therefore, in order to deploy Tomcat WEB-INF/ folder must exist in application directory and no Main-Class configured in application's MANIFEST.MF file, which is illustrated as follows:
$ ls -l
total 16
drwxrwxr-x 4 sysadm sysadm 4096 4月   9 11:30 BOOT-INF
drwxrwxr-x 2 sysadm sysadm 4096 6月  25 13:06 META-INF
drwxrwxr-x 3 sysadm sysadm 4096 12月  6  2019 org
drwxrwxr-x 2 sysadm sysadm 4096 6月  11 21:08 WEB-INF

$ cat ./META-INF/MANIFEST.MF
Manifest-Version: 1.0
Start-Class: org.cloudfoundry.test.Application
Spring-Boot-Version: 2.2.2.RELEASE
Spring-Boot-Classes: BOOT-INF/classes/
Spring-Boot-Lib: BOOT-INF/lib/
Then Tomcat will be deployed when staging the application.
Staging app and tracing logs...
   Downloading java_buildpack_offline...
   Downloaded java_buildpack_offline
   ......
   -----> Downloading Spring Auto Reconfiguration 2.11.0_RELEASE from https://java-buildpack.cloudfoundry.org/auto-reconfiguration/auto-reconfiguration-2.11.0-RELEASE.jar (found in cache)
   -----> Downloading Tomcat Instance 9.0.33 from https://java-buildpack.cloudfoundry.org/tomcat/tomcat-9.0.33.tar.gz (found in cache)
          Expanding Tomcat Instance to .java-buildpack/tomcat (0.2s)
   -----> Downloading Tomcat Access Logging Support 3.3.0_RELEASE from https://java-buildpack.cloudfoundry.org/tomcat-access-logging-support/tomcat-access-logging-support-3.3.0-RELEASE.jar (found in cache)
   -----> Downloading Tomcat Lifecycle Support 3.3.0_RELEASE from https://java-buildpack.cloudfoundry.org/tomcat-lifecycle-support/tomcat-lifecycle-support-3.3.0-RELEASE.jar (found in cache)
   -----> Downloading Tomcat Logging Support 3.3.0_RELEASE from https://java-buildpack.cloudfoundry.org/tomcat-logging-support/tomcat-logging-support-3.3.0-RELEASE.jar (found in cache)
   Exit status 0
   Uploading droplet, build artifacts cache...