Caused by: java.lang.IllegalStateException:
OAuth2Credentials instance does not support refreshing the access token.
An instance with a new access token should be used,
or a derived type that supports refreshing should be used.
final GoogleCredentials credentials = ServiceAccountCredentials.fromStream(stream)
.createScoped(SCOPE);
final AccessToken token = credentials.refreshAccessToken();
Some how I just can't refresh the access token even I generate another credential.json , using an Compute Engine default service account .
I see ServiceAccountCredentials does override refreshAccessToken(), so I replaced it , still not work.
I got these error recently, sometime it works, or not...=(
It says Network is unreachable, but I'm sure I could connect www.google.com/ncr.
Is there anything wrong?
Some how I just can't refresh the access token even I generate another
credential.json
, using anCompute Engine default service account
. I seeServiceAccountCredentials
does overriderefreshAccessToken()
, so I replaced it , still not work.