title: springboot+mybatis Exception : org.springframework.beans.factory.NoSuchBeanDefinitionException
body: <p>I got the following exception:</p>
  
  <blockquote>
    <p>org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [pers.panxin.springboot.demo.mapper.UserMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}</p>
  </blockquote>
  
  <p>Controller :</p>
  
  <pre><code>@Controller
  public class HelloController {
  
      @Autowired
      private UserService userService;
  
      @RequestMapping("/userList")
      @ResponseBody
      public String getAllUser(){
          return "userList : "+userService.getAllUser().toString();//+list.toString();
      }
  
  }
  </code></pre>
  
  <p>Service:</p>
  
  <pre><code>public interface UserService {
  
      public String getString();
  
      public List&lt;User&gt; getAllUser();
  
  }
  </code></pre>
  
  <p>ServiceImpl:</p>
  
  <pre><code>@Service
  public class UserServiceImpl implements UserService {
  
      @Autowired
      private UserMapper userMapper;
  
      @Override
      public String getString() {
          return "something else ... ";
      }
  
      @Override
      public List&lt;User&gt; getAllUser() {
          return userMapper.getAllUser();
      }
  }
  </code></pre>
  
  <p>Mapper Interface:</p>
  
  <pre><code>@Service
  public interface UserMapper {
  
      /**
       * @return
       */
      public List&lt;User&gt; getAllUser();
  
  }
  </code></pre>
  
  <p>Application's main class</p>
  
  <pre><code>@ComponentScan
  @EnableAutoConfiguration
  @SpringBootApplication
  public class ApplicationStarter {
  
      public static void main(String[] args) {
          SpringApplication.run(ApplicationStarter.class, args);
      }
  
  }
  </code></pre>
  
  <p>how the exception happened or something wrong in my code?</p>