nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

huangapple go评论119阅读模式
英文:

nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

问题

我目前正在进行一个基于Spring的网页项目课程,遇到了以下异常情况,但我无法找到解决方法。

org.springframework.beans.factory.BeanCreationException: 在 ServletContext 资源 [/WEB-INF/dispatcher-servlet.xml] 中定义的名为 'entityManagerFactory' 的 bean 创建时出错:调用 init 方法失败;嵌套异常是 org.hibernate.HibernateException: 当未设置 'hibernate.dialect' 时,无法将 DialectResolutionInfo 访问为空


这是完整项目的链接:

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

如果有人能够对其进行调试并告诉我问题出在哪里,那将非常有帮助。

谢谢。
英文:

I am currently working on a web Spring school project, and I ran into this exception and I can't find my way out of it.

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

here's the link to the full project :

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

if someone can debug it and tell me where the problem is, that would be very helpful.

My thanks.

答案1

得分: 1

你缺少一个应用程序属性,即 spring.jpa.database-platform。您应根据您使用的数据库进行适当设置。例如:spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect

附注:这可能不是您唯一缺少的属性,您应该添加您的 application.properties 文件以查看您可能存在的其他问题。

英文:

You are missing a application property, spring.jpa.database-platform. You should set it accordingly to the database you are using. E.g. spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect

P.S. This might not be the only property you are missing, you should add your application.properties file to see what other problems you might have.

huangapple
  • 本文由 发表于 2020年9月20日 03:16:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/63972552.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定