False 'Could not autowire' message in beans.xml

I have the following xml file :

 
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
        default-autowire="byType">


    <bean id="logger" class="com.skiabox.apps.Logger">

    </bean>

    <bean id="consoleWriter" class="com.skiabox.apps.ConsoleWriter" primary="true">

    </bean>

    <bean id="panda" class="com.skiabox.apps.ConsoleWriter">

    </bean>

    <bean id="fileWriter" class="com.skiabox.apps.FileWriter">

    </bean>

    <bean id="squirrel" class="com.skiabox.apps.FileWriter" autowire-candidate="false">

    </bean>
</beans>


and the logger bean gives a 'Could not autowire' error although I have added the primary property to the first bean of ConsoleWriter type.
The application compiles an run successfully.
So probably this is a bug.

1 comment
Comment actions Permalink

Could you please create an issue https://youtrack.jetbrains.com/issues/IDEA and attach the sample project as ZIP? Thanks.

0

Please sign in to leave a comment.