apache / shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Apache License 2.0
19.87k stars 6.73k forks source link

spring-data-jdbc error is supported for version 5.1.1 #17296

Closed deploymentadmin closed 2 years ago

deploymentadmin commented 2 years ago

a bean of type 'org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations' that could not be found. but 4.0.0 version is ok

linghengqian commented 2 years ago

Try updating your org.springframework.boot:spring-boot-starter-parent version to 2.6.7. This class belongs to the Spring Framework and still exists in the main branch. See https://github.com/spring-projects/spring-framework/blob/main/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcOperations.java .

deploymentadmin commented 2 years ago

image that is Spring cannot initialize the data source, spring.datasource config is ok. Is there an example for spring-data-JDBC?

linghengqian commented 2 years ago

@deploymentadmin Normally not, because as far as I know Spring Data JDBC is usually used to integrate into the Mapper layer of Mybatis, I don't see any problems in this area. I think you can provide a minimal example of a recurring problem. (Looks like you did some extra configuration on Spring.)