Sukerin opened a new issue #7933:
URL: https://github.com/apache/shardingsphere/issues/7933


   when i use
   ```
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               
<artifactId>sharding-jdbc-orchestration-spring-boot-starter</artifactId>
               <version>${sharding-sphere.version}</version>
           </dependency>
   ```
   project doesnot work.
   
   ```
   
   2020-10-27 17:36:02.382 ERROR 8348 --- [           main] 
o.s.boot.SpringApplication               : Application run failed
   
   org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'accountService': Unsatisfied dependency expressed 
through field 'baseMapper'; nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying 
bean of type 'org.sukerin.shardingjdbc.dao.AccountDao' available: expected at 
least 1 bean which qualifies as autowire candidate. Dependency annotations: 
{@org.springframework.beans.factory.annotation.Autowired(required=true)}
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:893)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
 ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
 ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
 ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) 
[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) 
[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
 [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:315) 
[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) 
[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) 
[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
        at 
org.sukerin.shardingjdbc.ShardingJdbcApplication.main(ShardingJdbcApplication.java:10)
 [classes/:na]
   Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: 
No qualifying bean of type 'org.sukerin.shardingjdbc.dao.AccountDao' available: 
expected at least 1 bean which qualifies as autowire candidate. Dependency 
annotations: 
{@org.springframework.beans.factory.annotation.Autowired(required=true)}
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1714)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1270)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1224)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
 ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        ... 20 common frames omitted
   
   
   
   
   ```
   
   the accountDao code(by mybatis-plus):
   ```
   @Mapper
   public interface AccountDao extends BaseMapper<Account> {
   }
   
   
   ```
   
   when i delete the dependency, it works.
   
   These are some dependencies I think related to this
   
   ```
   <sharding-sphere.version>4.1.1</sharding-sphere.version>
   
   <dependency>
               <groupId>mysql</groupId>
               <artifactId>mysql-connector-java</artifactId>
               <scope>runtime</scope>
           </dependency>
   
   
           <!-- mybatis -plus start -->
           <dependency>
               <groupId>com.baomidou</groupId>
               <artifactId>mybatis-plus-boot-starter</artifactId>
               <version>3.3.2</version>
           </dependency>
   
   
           <dependency>
               <groupId>com.alibaba</groupId>
               <artifactId>druid</artifactId>
               <version>1.1.22</version>
           </dependency>
   
   ```
   
   I need some help~
   


----------------------------------------------------------------
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.

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


Reply via email to