Closed kamalhm closed 2 years ago
Which dependencies are you including? This property is being read by GcpContextAutoConfiguration
, but you must import one of the Spring Cloud GCP starters to trigger it. Not seeing FileNotFoundException
can also mean that nothing is using this property.
here are all my included dependencies
implementation 'com.google.cloud:spring-cloud-gcp-starter'
implementation platform('com.google.cloud:libraries-bom:22.0.0')
implementation 'com.google.cloud:google-cloud-kms'
i'm using springboot 2.5.4
Not seeing FileNotFoundException can also mean that nothing is using this property.
when I try to put the wrong filename, it detects that the file was not found
Which beans are you using? You probably need google-cloud-starter-kms
to actually get any auto-configured beans. Also, sample code that reproduces the issue would be useful in debugging.
my bad, it works fine if I use full path, not sure why I couldn't get classpath
to work
I've stored my credentials on resources, named
cred.json
, and put this into the properties.applicationspring.cloud.gcp.credentials.location=classpath:cred.json
The file was able to be read because there's no FileNotFoundException, but spring cloud didn't detect the credentials and throw this error
Caused by: java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.