BeanCreationException: ошибка при создании bean-компонента с именем entityManagerFactory, определенным в ресурсе пути к классу - PullRequest
0 голосов
/ 16 июня 2020
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #1 of URL [file:/C:/Users/me/Downloads/Student-API-2.0/target/classes/data.sql]: insert into Student values(17,"Nil","aj@gmail.com"); nested exception is org.h2.jdbc.JdbcSQLException: Column "Nil" not found; SQL statement:
insert into Student values(17,"Nil","aj@gmail.com") [42122-197]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]   
Caused by: org.h2.jdbc.JdbcSQLException: Column "Nil" not found; SQL statement:
insert into Student values(17,"Nil","aj@gmail.com") [42122-197]

enter image description here

enter image description here

1 Ответ

0 голосов
/ 16 июня 2020

Вы можете указать имена столбцов в предложении sql, чтобы убедиться, что оно не соответствует значению с именем столбца.

insert into Student(column1, column2, column3) values(17,'Nil','aj@gmail.com')
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...