Vi outros relatos aqui do mesmo erro mas não consegui solucionar no meu caso, ao subir a aplicação recebo o seguinte erro:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-06-24 15:50:51.899 ERROR 15188 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
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
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
O erro diz que a url no datasource não está configurada, mas aparentemente fiz tudo da maneira certa.
Meu Application.yml do fornecedor:
server:
port: 8081
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8761/eureka
Application.yml do config-server:
server:
port: 8888
spring:
profiles:
active: native #indicando que ele ira buscar as config dentro do filesystem
cloud:
config:
server:
native:
search-locations: C:\microservice-repo
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
Bootstrap.yml do fornecedor:
spring:
application:
name: 'fornecedor'
profiles:
active: default
cloud:
config:
uri: http://localhost:8888
fornecedor.yml do diretório C:\microservice-repo:
spring:
datasource:
password: root
username: root
url: jdbc:mysql://localhost:3306/fornecedor?useTimezone=true&serverTimezone=America/Sao_Paulo
jpa:
hibernate:
ddl-auto: update