Olá pessoal, Estou tendo um problema que outros colegas já tiveram, quando eu rodo o projeto com o data.sql já inserido no devido local, ele retorna erro:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #1 of URL [file:/Users/ricardofellini/Downloads/APISpring/target/classes/data.sql]: INSERT INTO USUARIO(nome, email, senha) VALUES('Aluno', 'aluno@email.com', '123456'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "USUARIO" not found; SQL statement: INSERT INTO USUARIO(nome, email, senha) VALUES('Aluno', 'aluno@email.com', '123456') [42102-200]
Observacoes: Já adicionei o parametro no arquivo application.properties e continua o problema.
datasource
spring.datasource.driverClassName=org.h2.Driver spring.datasource.url=jdbc:h2:mem:alura-forum spring.datasource.username=sa spring.datasource.password=
jpa
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect spring.jpa.hibernate.ddl-auto=update spring.jpa.defer-datasource-initialization=true
h2
spring.h2.console.enabled=true spring.h2.console.path=/h2-console