"Could not locate PropertySource: Error requesting access token" error while an application in Tanzu Application Service for VMs fails to start
search cancel

"Could not locate PropertySource: Error requesting access token" error while an application in Tanzu Application Service for VMs fails to start

book

Article ID: 297105

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

A application in Tanzu Application Service for VMs (TAS for VMs) fails to start with a warning message "Could not locate PropertySource: Error requesting access token".

The application that is dependent on a config-server fails to start with error:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myBeanName':


Resolution

The warning message indicates that the application fails to retrieve an access token from UAA.

You can try the following options to capture additional information or stack trace to find out what cause it, either set failFast to true or set security-oauth2 package to debug.

1. Set failFast to true. This provides the capability for the application to exit fast if an exception is encountered. This setting generates a stack trace. This is most helpful if the issue is encountered sporadically.
$ cf set-env <APP-NAME> spring.cloud.config.failFast true

2. Set security-oauth2 package to debug. This provides the capability for the application to generate additional log entries to help identify the root cause. 
$ cf set-env <APP-NAME> logging.level.org.springframework.security.oauth2 debug