250x250
반응형
Notice
Recent Posts
Recent Comments
Link
«   2024/06   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Archives
Today
Total
관리 메뉴

BEAT A SHOTGUN

[TROUBLESHOOTING] hibernate.dialect not set 본문

TROUBLESHOOTING

[TROUBLESHOOTING] hibernate.dialect not set

thovy 2023. 10. 28. 18:10
728x90
반응형
SMALL

전자정부 프레임워크, spring boot, mysql 로 프로젝트를 만들면서 특정 Api 를 구동하면 이런 에러가 나왔다

❌ERROR

Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

hibernate.dialect 가 설정되어 있지 않아서 생기는 에러 같다.

✅SOLUTION

src/main/resources/application.properties 에서 mysql

...

# JPA Setting Info
logging.level.org.hibernate.type.descriptor.sql: DEBUG
# 여기 hibernate 부분을 수정해줘야한다.
spring.jpa.properties.hibernate.diarect: org.hibernate.dialect.HSQLDialect ❌
spring.jpa.properties.hibernate.dialect: org.hibernate.dialect.MySQL5InnoDBDialect✅

spring.jpa.properties.hibernate.format_sql: true
spring.jpa.properties.hibernate.show_sql: true
spring.jpa.properties.hibernate.use_sql_comments: true
spring.jpa.hibernate.id.new_generator_mappings: true
spring.jpa.hibernate.ddl-auto: create

...

물론 위에 정의된 DB부분은 당연히 mysql 로 맞춰줘야겠지.
않이 근데 다른 api들은 DB와 잘 연결되고 에러도 발생 안 하면서 데이터 잘 가져왔는데,
왜 특정 api만 저런 에러를 발생시킬까

그리고 초기 설정에서 diarect 라고 적혀있는거 원래 저렇게 적혀 있는 거임. 내가 낸 오타 아님.
전자정부 프레임워크를 만든 사람들도 다 같은 사람이구나😀

참고

https://velog.io/@gloom/Spring-%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EC%97%B0%EB%8F%99-%EC%8B%9C-Access-to-DialectResolutionInfo-cannot-be-null-when-hibernate.dialect-not-set-%EC%98%A4%EB%A5%98

728x90
반응형
LIST
Comments