使用StrategySelectionException和BeanCreationException (entityMa



请帮忙下一期,谢谢。我需要在一个旧项目中进行更改,但问题是我甚至无法启动应用程序。我有下一个问题。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException:
Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
caused by
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
caused by 
org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.spatial.dialect.mysql.MySQLSpatial5InnoDBDialect] as strategy [org.hibernate.dialect.Dialect]

这只从一个问题的结尾开始。完整的错误描述可以在intelllij terminal.txt"文件"problem中找到在这里https://drive.google.com/drive/folders/14QZvGvUGkGp116Q2ENLywG3nziqJyp2J?usp=sharing

同样在同一个链接中,你会发现这些文件"application properties.txt"one_answers"pomxml.txt">

请随便问。

由于代码是几年前编写的,那么:

  • 我从java 11升级到java 8。
  • 我将url更改为spring.datasource.url=jdbc:mysql://localhost:3306/fds?useUnicode=yes&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&useSSL=false
  • 我还添加了版本的依赖mysql-connector-java 5.1.49
  • 我删除了"spring.jpa.database-platform = org.hibernate.spatial.dialect.mysql.MySQLSpatial5InnoDBDialect"。
  • 我添加了"spring. jsp .properties.hibernate.dialect= org.hibernate.spatial.dialect.mysql.MySQL56InnoDBSpatialDialect">
  • 我添加了一个依赖:org。5.4.15.Final
  • 我添加了一个依赖项:org.hibernateli>我添加了一个依赖项:javax.xml.bind/ul>

最新更新