SpringBoot升级过程中的坑二
1.Error creating bean with name ‘jdbcDialect’ defined in class path resource
把springboot从2.1.X升级到2.3.2.RELEASE,以前的代码再次运行之后,出现了问题:
Error creating bean with name 'jdbcDialect' defined in class path resource [org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesAutoConfiguration$SpringBootJdbcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.relational.core.dialect.Dialect]: Factory method 'jdbcDialect' threw exception; nested exception is org.springframework.data.jdbc.repository.config.DialectResolver$NoDialectException: Cannot determine a dialect for org.springframework.jdbc.core.JdbcTemplate@738a39cc. Please provide a Dialect.
还有提示:
Cannot determine a dialect for org.springframework.jdbc.core.JdbcTemplate@7ecb9e17. Please provide a Dialect.
最后解决的方法就是将pom.xml中的spring-boot-starter-data-jdbc换成spring-boot-starter-jdbc。
1 | <!--<dependency>--> |
1.Spring Boot 启动报错Error creating bean with name ‘dataSource’ defined in class path resource
2.New Error in spring boot 2.3.0.RELEASE : UnsatisfiedDependencyException for Oracle 12.2.0.1 jdbcdriver but not with mysql jdbcdriver (这里是一个解决问题的启发文章)
3.Migrating to Spring Data JDBC 2.0 (这里讲了如何升级到jdbc-2.0)
4.Spring Data JDBC Firebird dialect not recognized (这里提出了解决问题的方法)
2.Error:(37, 81) java: 不兼容的类型: java.lang.String无法转换为java.util.List<java.lang.String>
在使用Sort生成排序规则的时候,出现了这样的问题:
1 |
|
解决方法就是使用Sort.by替代:
1 |
|