嵌套的异常是org.hibernate.HibernateException:如果未设置“ hibernate.dialect”,则对DialectResolutionInfo的访问不能为null

问题描述

我目前正在从事Web春季学校项目,但是遇到了这个异常,我找不到办法。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Invocation of init method Failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

这是整个项目的链接

https://drive.google.com/drive/folders/1-PgJ8PeUSdC4NhVVSK89xAbCM72ZB-bJ?usp=sharing

如果有人可以调试它并告诉我问题出在哪里,那将非常有帮助。

谢谢。

解决方法

您缺少应用程序属性spring.jpa.database-platform。您应该将其相应地设置为所使用的数据库。例如。 spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect

P.S。这可能不是您唯一缺少的属性,应该添加application.properties文件以查看可能遇到的其他问题。