TAS application failing at deployment after upgrading Java 8 to Java 17
search cancel

TAS application failing at deployment after upgrading Java 8 to Java 17

book

Article ID: 410748

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

You updated your application from Java v8 to Java v17 and redeployed the app to TAS.  You try to re-deploy the app and fails, showing with errors similar as below:

[APP/PROC/WEB/0] ERR Unrecognized VM option 'PrintHeapAtGC'.
[APP/PROC/WEB/0] ERR Error: Could not create the Java Virtual Machine.
[APP/PROC/WEB/0] ERR Error: A fatal exception has occurred. Program will exit.

Note: the above error mentions 'PrintHeapAtGC' as unrecognized VM option. This is indicative of an application that is using stale/unsupported flags from Java v8 when pushed, such as 'PringHeapAtGC' which isn't valid in Java 17.

Cause

The errors indicate that there was some stale config from Java 8 that is still being referenced by TAS/env, which causes the app re-deployment to fail. For example:

  • Old Java version pinned/bound to app
  • Leftover JVM flags / environment variables
  • Foundation environment variable groups are being overwritten somewhere in pipeline.
  • Using custom Java buildpacks 

This leaves the app in bad/failed state.

Resolution

Rename & re-push app as new.

If this does not resolve the issue then it is suggested to open a ticket with TANZU Support.