title: Spring boot CrudRepo Define a bean
body: <p>I have a problem in spring boot concerning repositories.
  I have a service :</p>
  
  <pre><code>@Service("userService")
  public class UserServiceImpl implements UserService {
  
    @Autowired
    private UserRepository userRepository;
  
    @Autowired
    private RoleRepository roleRepository;
  }
  </code></pre>
  
  <p>and the repos here :</p>
  
  <pre><code>@Repository("userRepository")
  public interface UserRepository extends CrudRepository&lt;User, Long&gt; {
       User findByEmail(String email);
  }
  </code></pre>
  
  <p>When I run the app I get this message :</p>
  
  <pre><code>Description:
  
  Field userRepository in com.projectWS.service.UserServiceImpl required a 
  bean of type 'com.projectWS.repo.UserRepository' that could not be found.
  
  Action:
  
  Consider defining a bean of type 'com.projectWS.repo.UserRepository' in your 
  configuration.
  </code></pre>
  
  <p>Please help me I'm so desperate...
   this is my main class:</p>
  
  <pre><code>@SpringBootApplication
  @Configuration
  @EnableWebMvc
  public class Main {
  
     public static void main(String[] args) {
      SpringApplication.run(Main.class, args);
     }
  }
  </code></pre>
  
  <p>Another problem is , <code>@EnableJpaRepositories</code> doesn't get recognized !!</p>