TokenException when using cf java client
search cancel

TokenException when using cf java client

book

Article ID: 297153

calendar_today

Updated On:

Products

Support Only for Spring

Issue/Introduction

A TokenException error can be seen as follows when using the cf java client:
2020-05-27 00:25:57 ERROR org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler Unexpected error occurred in scheduled task org.cloudfoundry.reactor.util.Operator$ResponseReceiver$InvalidTokenException: null Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Assembly trace from producer [reactor.core.publisher.MonoCacheTime] : reactor.core.publisher.Mono.checkpoint(Mono.java:1877) org.cloudfoundry.reactor.tokenprovider.AbstractUaaTokenProvider.token(AbstractUaaTokenProvider.java:255)

This error is related to the expiration of the Authorization/Refresh Token, where the TokenProvider is no longer refreshing the Refresh Token automatically.

This error has also be seen in Spring Cloud Data Flow Tile 1.8.0 and 1.7.0 service broker.

Environment

Product Version: 1.8

Resolution

The fix will be introduced in cf java client 4.7.1 and 3.25 and in Spring Cloud Data Flow 1.8.1+.

In the meantime, the following workaround has been found:
  • For an app using cf java client, restarting the app will temporarily solve the issue since it will reauthenticate again.
  • For SCDF, restarting the service broker will have same effect.