3
respostas

Erro ao subir fornecedor

Conseguem me ajudar? Pesquisei, mas não conseguir resolver. Deu esse erro...

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-11-08 16:48:40.475 ERROR 27324 --- [           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).

No config-server pelo postman está dando 404

3 respostas

Gabriel

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Pela mensagem de erro suspeito que não está conseguindo ler do config-server.

fornecedor.yaml

spring:
  datasource:
    password: root
    username: root
    url: 'jdbc:mysql://localhost:3307/fornecedor'
  jpa:
    hibernate:
      ddl-auto: update

Como está seu application.yaml do config-server? Envia o bootstrap.yml e application.yml do fornecedor também, por favor

Obrigado por responder!

o application.yml do config-serve está assim :

server:
  port: 8888

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/gabrielsm14/microservice-repo
          search-paths: fornecedor

application.yml do fornecedor:


server:
  port: 8081

eureka:
  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
      defaultZone: http://localhost:8761/eureka

bootstrap.yml do fornecedor:

spring:
  application:
    name: 'fornecedor'
  profiles:
    active: default
  cloud:
    config:
      uri: http://localhost:8888

Obrigado pela ajuda!

Oi Gabriel

No seu github está "forneceedor" (com dois "e") e no application.yml:

search-paths: fornecedor