title: Unsatisfied dependency expressed through field 'userRepos'; nested exception is org.springframework.beans.factory.BeanCreationException:
body: <p>There is a User Bean as the model. The controller class is UserController and UserRepository is the repository class.</p>
  
  <p>This is the model class</p>
  
  <pre><code>@Entity
  public class User {
  
      @Id()
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Long id;
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      private String first_name;
      private String last_name;
      private String email;
      private String password;
  
      public String getFirst_name() {
          return first_name;
      }
  
      public void setFirst_name(String first_name) {
          this.first_name = first_name;
      }
  
      public String getLast_name() {
          return last_name;
      }
  
      public void setLast_name(String last_name) {
          this.last_name = last_name;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public String getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = password;
      }
  }
  </code></pre>
  
  <p>This is the Controller class:</p>
  
  <pre><code>package com.prashant.flightreservation.controllers;
  
  @Controller
  public class UserController {
  
      @Autowired
      private UserRepository userRepos;
  
      @RequestMapping("/showReg")
      public String showRegistrationPage() {
          return "registerUser";
      }
  
      @RequestMapping(value = "registerUser", method = RequestMethod.POST)
      public String register(@ModelAttribute("user") User user) {
          userRepos.save(user);
          return "login";
  
      }
  
  }
  </code></pre>
  
  <p>Repository
  Do I need to implement this interface?</p>
  
  <pre><code>public interface UserRepository extends JpaRepository&lt;User, Long&gt; {
  
  }
  </code></pre>
  
  <p>The following exception is thrown:</p>
  
  <blockquote>
    <p>Unsatisfied dependency expressed through field 'userRepos'; nested
    exception is org.springframework.beans.factory.BeanCreationException:</p>
  </blockquote>