Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set.

Tags:

I am getting exception even after setting hibernate.dialect property. I am using hibernate 5.0.11 with spring boot 1.4.2 and mysql version as 5.7

application.properties is like this  # Hibernate hibernate.dialect=org.hibernate.dialect.MySQL5Dialect hibernate.show_sql=true hibernate.hbm2ddl.auto=validate 

pom.xml

    <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-web</artifactId>     </dependency>     <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-test</artifactId>         <scope>test</scope>     </dependency>     <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-actuator</artifactId>     </dependency>     <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-jdbc</artifactId>     </dependency>      <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-aop</artifactId>     </dependency>     <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-security</artifactId>     </dependency>     <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->     <dependency>         <groupId>org.projectlombok</groupId>         <artifactId>lombok</artifactId>     </dependency>     <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-data-jpa</artifactId>     </dependency> 

What is issue here ?

like image 682
praveen jain Avatar asked Nov 24 '16 06:11

praveen jain


People also ask

How do you resolve access to Dialectresolutioninfo Cannot be null when Hibernate dialect not set?

Note: To resolve error “access to dialectresolutioninfo cannot be null when 'hibernate. dialect' not set”. Make sure you have mysql driver and username, password correct. In spring boot for jpa java config you need to extend JpaBaseConfiguration and implement it's abstract methods.

How do I set Hibernate dialect?

SQL Dialects in Hibernate The dialect specifies the type of database used in hibernate so that hibernate generate appropriate type of SQL statements. For connecting any hibernate application with the database, it is required to provide the configuration of SQL dialect.

What is hibernate dialect for Oracle?

Dialect in Hibernate – Dialect is a class and a bridge between Java JDBC types and SQL types, which contains mapping between java language data type and database datatype. Dialect allows Hibernate to generate SQL optimized for a particular relational database.

What is the dialect for PostgreSQL?

SQL Is the Language for Talking to Databases PostgreSQL, MySQL, Oracle, and SQL Server are all database products by different vendors.


1 Answers

Adding the following line to the properties file solve this problem when I had that error.

spring.jpa.database=mysql 
like image 183
riorio Avatar answered Sep 20 '22 17:09

riorio