Alex
Alex
Explore posts from servers
JCHJava Community | Help. Code. Learn.
Created by Alex on 9/30/2024 in #java-help
jpa and postgresql
I can't find the reason of the error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: org/hibernate/mapping/RelationalModel
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: org/hibernate/mapping/RelationalModel
application.yaml
spring:
application:
name: 23-Spring-6-IoC-XML-BEAN-LIFECYCLE
datasource:
url: jdbc:postgresql://localhost:5432/springdata?currentSchema=public
username: postgres
password: root
driver-class-name: org.postgresql.Driver
jpa:
properties:
hibernate:
show_sql: true
format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
hibernate:
ddl-auto: validate

logging:
level:
root: info
file:
name: demo.log
path: /
spring:
application:
name: 23-Spring-6-IoC-XML-BEAN-LIFECYCLE
datasource:
url: jdbc:postgresql://localhost:5432/springdata?currentSchema=public
username: postgres
password: root
driver-class-name: org.postgresql.Driver
jpa:
properties:
hibernate:
show_sql: true
format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
hibernate:
ddl-auto: validate

logging:
level:
root: info
file:
name: demo.log
path: /
pom.xml
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.ladsn</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.1.3</version>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.ladsn</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.1.3</version>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
5 replies