Miaoxianshengo opened a new issue, #29866:
URL: https://github.com/apache/shardingsphere/issues/29866

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   
   org.apache.shardingsphere:shardingsphere-jdbc-core-spring-boot-starter:5.2.1
   
   
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   kotlin springboot  ShardingSphereJDBC
   
   ### Expected behavior
   start springboot
   
   ### Actual behavior
   
   ### Reason analyze (If you can)
   ShardingSphere mybatisplus kotlin Used together
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   kotlin version 1.9.21 mybatisplus version  
com.baomidou:mybatis-plus-boot-starter:3.5.5
   
![WechatIMG109](https://github.com/apache/shardingsphere/assets/46678422/18e448b6-18ed-4aa9-a742-a2df847db1b5)
   
   ### Error
   org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'shortLinkServiceImpl': Unsatisfied dependency 
expressed through field 'baseMapper'; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'shortLinkMapper' defined in file 
[/Users/zhumengchi/Desktop/工具项目/short-link/link-v/build/classes/kotlin/main/com/miao/linkv/mapper/ShortLinkMapper.class]:
 Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; 
nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'sqlSessionFactory' defined in class path resource 
[com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: 
Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 
0; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'dataSource' defi
 ned in class path resource 
[org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.class]: 
Unsatisfied dependency expressed through method 'dataSource' parameter 0; 
nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying 
bean of type 'org.apache.shardingsphere.infra.config.mode.ModeConfiguration' 
available: expected at least 1 bean which qualifies as autowire candidate. 
Dependency annotations: {}
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
 ~[spring-context-5.3.23.jar:5.3.23]
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
 ~[spring-context-5.3.23.jar:5.3.23]
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
 ~[spring-boot-2.7.5.jar:2.7.5]
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) 
~[spring-boot-2.7.5.jar:2.7.5]
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
 ~[spring-boot-2.7.5.jar:2.7.5]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:308) 
~[spring-boot-2.7.5.jar:2.7.5]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) 
~[spring-boot-2.7.5.jar:2.7.5]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) 
~[spring-boot-2.7.5.jar:2.7.5]
        at com.miao.linkv.LinkVApplicationKt.main(LinkVApplication.kt:16) 
~[main/:na]
   Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'shortLinkMapper' defined in file 
[/Users/zhumengchi/Desktop/工具项目/short-link/link-v/build/classes/kotlin/main/com/miao/linkv/mapper/ShortLinkMapper.class]:
 Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; 
nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'sqlSessionFactory' defined in class path resource 
[com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: 
Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 
0; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'dataSource' defined in class path resource 
[org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.class]: 
Unsatisfied dependency expressed through method 'dataSource' parameter 0; 
nested exc
 eption is org.springframework.beans.factory.NoSuchBeanDefinitionException: No 
qualifying bean of type 
'org.apache.shardingsphere.infra.config.mode.ModeConfiguration' available: 
expected at least 1 bean which qualifies as autowire candidate. Dependency 
annotations: {}
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1534)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1417)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656)
 ~[spring-beans-5.3.23.jar:5.3.23]
        ... 20 common frames omitted
   Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'sqlSessionFactory' defined in class path 
resource 
[com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: 
Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 
0; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'dataSource' defined in class path resource 
[org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.class]: 
Unsatisfied dependency expressed through method 'dataSource' parameter 0; 
nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying 
bean of type 'org.apache.shardingsphere.infra.config.mode.ModeConfiguration' 
available: expected at least 1 bean which qualifies as autowire candidate. 
Dependency annotations: {}
        at 
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1519)
 ~[spring-beans-5.3.23.jar:5.3.23]
        ... 31 common frames omitted
   Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'dataSource' defined in class path resource 
[org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.class]: 
Unsatisfied dependency expressed through method 'dataSource' parameter 0; 
nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying 
bean of type 'org.apache.shardingsphere.infra.config.mode.ModeConfiguration' 
available: expected at least 1 bean which qualifies as autowire candidate. 
Dependency annotations: {}
        at 
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
 ~[spring-beans-5.3.23.jar:5.3.23]
        ... 44 common frames omitted
   Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: 
No qualifying bean of type 
'org.apache.shardingsphere.infra.config.mode.ModeConfiguration' available: 
expected at least 1 bean which qualifies as autowire candidate. Dependency 
annotations: {}
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1801)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1396)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
 ~[spring-beans-5.3.23.jar:5.3.23]
        at 
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
 ~[spring-beans-5.3.23.jar:5.3.23]
        ... 58 common frames omitted


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to