title: Field required a bean of type ... that could not be found
body: <p>In my <code>Spring</code> project I have an interface:</p>
  
  <pre><code>public interface MyIntefrace {
  
      void myMethod(String myParam);
  }
  </code></pre>
  
  <p>and I have a class that implements it:</p>
  
  <pre><code>@Component
  @Profile("prod")
  public class MyImplementationClass implements MyInterface {
      ...
  </code></pre>
  
  <p>In my other class, I'm using this object as follows:</p>
  
  <pre><code>@Autowired
  MyInterface myinterface;
  
  ...
  
  myinterface.myMethod(someParam);
  </code></pre>
  
  <p>And it throws me an error:</p>
  
  <pre><code>Field myinterface in mypackage required a bean of type ... that could not be found.
  
  The injection point has the following annotations:
      - @org.springframework.beans.factory.annotation.Autowired(required=true)
  
  Consider defining a bean of type '...' in your configuration
  </code></pre>
  
  <p>I tried to add <code>@Service</code> annotation above <code>MyInterface</code> but that didn't help. What else can I do?</p>