1
resposta

Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource

Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Failed to execute SQL script statement #1 of URL [file:/C:/Users/Nicole/Desktop/Alura/ApiRestKotlin/target/classes/data.sql]: INSERT INTO Course(id, name, category) VALUES(1,'Kotlin','PROGRAMAÇÂO')

Insira aqui a descrição dessa imagem para ajudar na acessibilidadeOlá, como posso resolver este erro?

1 resposta

Oi Nicole!

Seu arquivo application.yml está incompleto. Deveria estar assim:

spring:
  datasource:
    driverClassName: org.h2.Driver
    url: jdbc:h2:mem:forum
    username: sa
    password:
  jpa:
    database-platform: org.hibernate.dialect.H2Dialect
    properties:
      hibernate:
        show_sql: true
        format_sql: true
  h2:
    console:
      enabled: true