hades

[JPA] not connection 본문

🏃🏻‍♂️ 기본훈련/Java

[JPA] not connection

hades1 2024. 7. 28. 11:09

🚨 에러

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'jakarta.persistence.jdbc.url' for common cases or 'hibernate.dialect' when a custom Dialect implementation must be provided)

 

🔍 분석

hibernate는 JPA와 관련되어 있고, Unable to create requested service로 보아 요청을 할 수 없다고 한다.

 

깜빡하고 데이터베이스를 생성하지 않았다...

 

👊 해결

H2 데이터베이스를 사용하고 있었는데, /h2/bin으로 이동 후, h2.bat로 H2 설정 화면으로 가서 데이터베이스를 생성하면 된다.

 

다른 데이터베이스를 사용할 경우에도, 그 안에서 알맞은 데이터베이스를 생성하면 된다.