Start problem application with StrategySelectionException and BeanCreationException (entityManagerFactory)

105 Views Asked by At

Please, help with the next issue, thank you. I am in a need to make changes in an old project, but problem is in that I even cann't to start the app. I have the next problem.

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]

This only from the end of a problem. Whole error description you can find in a file "problem from intellij terminal.txt" here https://drive.google.com/drive/folders/14QZvGvUGkGp116Q2ENLywG3nziqJyp2J?usp=sharing

Also by the same link you'll find there files "application properties.txt" and "pomxml.txt"

Please, feel free to ask anything else )

1

There are 1 best solutions below

0
On

As code was written few years ago, then:

  • I moved from java 11 to 8.
  • And I changed the url to spring.datasource.url=jdbc:mysql://localhost:3306/fds?useUnicode=yes&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&useSSL=false
  • And also I added version to the dependency mysql-connector-java 5.1.49
  • I removed " spring.jpa.database-platform=org.hibernate.spatial.dialect.mysql.MySQLSpatial5InnoDBDialect".
  • And I added "spring.jpa.properties.hibernate.dialect= org.hibernate.spatial.dialect.mysql.MySQL56InnoDBSpatialDialect"
  • And I added one dependency: org.hibernate hibernate-core 5.4.15.Final
  • And I added one dependency:org.hibernate</groupId hibernate-spatial 5.2.3.Final
  • And I added one dependency:javax.xml.bind</groupId jaxb-api 2.3.0