... is no accessor method
<p>I'm currently learning the ropes of Spring.<br>
I tried to <em>autowire</em> a method parameter like so:</p>

<pre><code>@RequestMapping("/hello")
public String something(@Autowire AnInterface ai) {
    ai.doSomething();
    return "/";
}
</code></pre>

<p>With the following interfaces and classes:</p>

<pre><code>@Component
public interface AnInterface {
    void doSomething();
}

@Component
public class Implementation implements AnInterface {
    @Autowired private AnotherInterface ai;

    public Implementation() { ; }

    public Implementation(AnotherInterface ai) {
        this.ai = ai;
    }

    public void setAi(AnotherInterface ai) {
        this.ai = ai;
    }

   @Override
   public void doSomething() {
       System.out.println(ai.hello());

   }
}

@Component
public interface AnotherInterface {
    String hello();
}

@Component
public class AnotherImplementation implements AnotherInterface {

    @Override
    public String hello() {
        return "hello";
    }

}
</code></pre>

<p>However, when calling the controller's method, I get an <code>IllegalArgumentException</code>:<br>
<code>Invoked method public abstract void AnInterface.doSomething() is no accessor method!</code></p>

<p>What am I doing wrong?</p>

<p>Thanks in advance :)</p>