1

I am trying to get access to SQLite by using "spring-boot-starter-data-jpa".

And the "application.properties" is used. The dialect is set at the "spring.jpa.database-platform". But the error of "DialectResolutionInfo cannot be null" happens. What should I do?

spring.jpa.database-platform=com.luminous.spring.dialect.SQLDialect
spring.jpa.hibernate.ddl-auto=create

spring.datasource.url=jdbc:sqlite:D:\\employee.db
spring.datasource.driver-class-name=org.sqlite.JDBC
spring.datasource.initialization-mode=always
spring.datasource.username = admin
spring.datasource.password = admin
Akira Tsuchiya
  • 53
  • 1
  • 1
  • 8

1 Answers1

2

Try adding spring.jpa.hibernate.dialect = org.hibernate.dialect.SQLiteDialect in application.properties file.

Also refer org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set for more possible solutions.

Alien
  • 15,141
  • 6
  • 37
  • 57
  • This will not work if you have to connect to 2 different database vendors such as DB2 and Oracle for example. How would you set hibernate dialect in that case? – pixel May 18 '22 at 22:30
  • In that case you might be configuring multiple data sources and can add dialect as part of configurations. – Alien May 19 '22 at 02:09
  • thanks. I did that, posted SO https://stackoverflow.com/questions/72296481/spring-boot-hibernate-error-access-to-dialectresolutioninfo-cannot-be-null-when – pixel May 19 '22 at 14:26