title: How should i fix required a bean of type that could not be found?
body: <p>I keep on getting an error: <code>"required a bean that could not be found."</code>
  And i really can't figure out why anymore.</p>
  
  <p>I saw that many had the same issue as me before but none of the given answers work for me. Tried rearranging packages, adding <code>@ComponentScan</code> to the application but nothing helped.   </p>
  
  <p>Part of my controller:</p>
  
  <pre><code>@RestController
  @RequestMapping("/api")
  public class JavarskiKontroler {
  
  @Autowired
  private JavarService javarService;
  
  @RequestMapping("/javari")
  public List&lt;Javar&gt; getAllJavars() {
      return javarService.getAllJavars();
  }
  
  @PostMapping("/javar")
  public Javar createJavar(@Valid @RequestBody Javar note) {
      return javarService.createJavara(note);
  }
  </code></pre>
  
  <p>Part of my service implementation (JavarService):</p>
  
  <pre><code>@Service
  public class JavarService {
  
  
  @Autowired
  private Javarer javarica;
  
  public List&lt;Javar&gt; getAllJavars() {
  
      return javarica.findAll();
  }
  
  public Javar createJavara(Javar note) {
  
      return javarica.save(note);
  }
  </code></pre>
  
  <p>My service(Javarer):</p>
  
  <pre><code>@Repository
  public interface Javarer extends JpaRepository&lt;Javar, Integer&gt; {
  }
  </code></pre>
  
  <p>And the error that I keep on getting: </p>
  
  <p><strong>Description:</strong></p>
  
  <pre><code> Field javarService in controller.JavarskiKontroler required a bean of type 'serviceImpl.JavarService' that could not be found.
  
  The injection point has the following annotations:
  - 
  @org.springframework.beans.factory.annotation.Autowired(required=true)
  
   Action:
  
   Consider defining a bean of type 'serviceImpl.JavarService' in your configuration.
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/bmslm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bmslm.png" alt="project structure:"></a></p>
  
  <p>It would be great if someone could at least point me to where I should look for the solution next, thanks anyway.</p>