JPA Could not load requested class;Unable to resolve name [x] as strategy[x]问题解决

爱被打了一巴掌 2022-09-09 13:56 97阅读 0赞

问题描述:

Caused by: java.lang.ClassNotFoundException: Could not load requested class : mysql
Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [mysql]
Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [mysql] as strategy [org.hibernate.dialect.Dialect]

问题分析:

1、Spring Boot配置里面没有设置数据库类型,导致报错。

解决办法:

(1)使用spring.datasource.platform设置数据库类型。

  1. spring.datasource.platform = mysql

(2)使用spring.jpa.database设置数据库类型。

  1. spring.jpa.database = mysql

发表评论

表情:
评论列表 (有 0 条评论,97人围观)

还没有评论,来说两句吧...

相关阅读