To Be Develop
[Spring Boot] Caused by: org.hibernate.service.spi.ServiceException: 본문
[Spring Boot] Caused by: org.hibernate.service.spi.ServiceException:
To Be Develop 2024. 2. 11. 12:56Error Message:
Caused by: org.hibernate.service.spi.ServiceException: 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)
---
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)
---
java.sql.SQLException: Access denied for user 'springuser'@'localhost' (using password: YES)
WARN 5189 --- [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadata
java.lang.NullPointerException: Cannot invoke
"org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(java.sql.SQLException, String)" because the return value of
"org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.sqlExceptionHelper()" is null
Caused by: org.hibernate.service.spi.ServiceException: 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)
Caused by: org.hibernate.HibernateException: 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)
---
위 에러 메시지는 spring boot 에서 mysql 을 연동할 때 발생한 것으로, 각각 다른 컴퓨터에서 연동할 때 발생한 문제점이다. 각각의 컴퓨터는 mysql 세팅이 달랐기 때문에 사용자 이름, 비밀번호, db 생성 등 몇 가지 수정을 해주어 해결하였다.
- 사용할 db 를 mysql에서 생성해주지 않았다.
- user name 과 비밀번호가 달랐다.
create database db_example; -- Creates the new database
create user 'springuser'@'%' identified by 'ThePassword'; -- Creates the user
grant all on db_example.* to 'springuser'@'%'; -- Gives all privileges to the new user on the newly created database
https://spring.io/guides/gs/accessing-data-mysql#scratch
'dev > SpringBoot' 카테고리의 다른 글
[Spring Boot] HTTP 302 error 발생 원인: 웹 애플리케이션 예시 (0) | 2024.02.09 |
---|---|
[Spring Boot] [Error] Caused by: java.lang.NoSuchFieldError: UUID (1) | 2024.02.08 |
[Spring Boot] JDBC, JdbcTemplate, JPA 차이점 및 활용법! (0) | 2024.02.07 |