Possible Bug in Spring Facets

If I expose a concrete class as a Bean in a @Configuration class IntelliJ till think the class is setup as a @Component and if it has a constructor that takes an argument I will get a "Class does not contain matching constructor for autowiring." error.

Try this:

public class MyBean {

     private MyOtherBean otherBean;


     public MyBean( MyOtherBean otherBean ) {

         this.otherBean = otherBean;


         ...

}


@Configuration

public class MyConfiguration {

    @Bean

    public MyOtherBean myOtherBean() {

        return new MyOtherBean();

    }

    @Bean

    public MyBean myBean() {

        return new MyBean( myOtherBean() );

    }

}

In this example MyBean.class shows up as red. If I add an @Inject annotation to the MyBean constructor the error goes away but I should not have to because I am manually wiring the bean in the configuration class. Any ideas?

Thanks!

R.

1 comment
Comment actions Permalink

Robert,

Please check it with IDEA 13.1 EAP: http://confluence.jetbrains.com/display/IDEADEV/IDEA+13.1+EAP.
If the issue still occurs please provide sample project for future investigation.

0

Please sign in to leave a comment.