Meu config client não consegue recuperar as informações do config server, ele loga que se conectou com o server, mas não consegue configurar o datasource:
2020-07-21 09:31:00.376 INFO 11220 --- [ restartedMain] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
2020-07-21 09:31:01.834 INFO 11220 --- [ restartedMain] c.c.c.ConfigServicePropertySourceLocator : Located environment: name=configServer, profiles=[default], label=null, version=null, state=null
2020-07-21 09:31:01.842 INFO 11220 --- [ restartedMain] b.c.a.m.f.FornecedorApplication : No active profile set, falling back to default profiles: default
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
As configurações no meu config server estão assim:
server:
port: 8888
spring:
profiles:
active: native
application:
name: configServer
cloud:
config:
server:
native:
search-locations: c:/Users/jorge_neto/Desktop/workspace/Alura/spring boot/micro-repo
As configurações no client estão assim:
spring:
application:
name: 'fornecedor'
cloud:
config:
name: configServer
enabled: true
uri: http://localhost:8888
no diretório tenho um arquivo chamado fornecedor.yml, com essas configs:
spring:
jpa:
hibernate:
ddl-auto: update
datasource:
url: jdbc:mysql://localhost:3306/fornecedor?useTimezone=true&serverTimezone=UTC
username: root
password: er45
no postman, o config server responde assim:
{
"name": "fornecedor",
"profiles": [
"default"
],
"label": null,
"version": null,
"state": null,
"propertySources": [
{
"name": "file:c:/Users/jorge_neto/Desktop/workspace/Alura/spring boot/micro-repo/fornecedor.yml",
"source": {
"spring.jpa.hibernate.ddl-auto": "update",
"spring.datasource.url": "jdbc:mysql://localhost:3306/fornecedor?useTimezone=true&serverTimezone=UTC",
"spring.datasource.username": "root",
"spring.datasource.password": "er45"
}
}
]
}