Using spring 2.5.5. Configuration runs annotated driven. Component Scan is activated.
A number of annotated classes working properly. Proper namespaces are added to spring configuration.
Problem. Spring container does not properly autowire my util:map bean
Excerpt from the bean-config:
<util:map id="networkTransportMap" >
<entry key="abc" value="def"/>
</util:map>
Excerpt from the @Component annotated class using the map:
@Autowired
@Qualifier("networkTransportMap")
private Map<String,String> networkTransportMap;
Log excerpt:
Error creating bean with name 'Bar': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Could not autowire field: private java.util.Map foo.Bar.networkTransportMap; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No matching bean of type [java.lang.String] found for dependency [map with value type java.lang.String]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Aut owired(required=true), @org.springframework.beans.factory.annotation.Qual ifier(value=networkTransportMap)}
at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor.postProcessAfterIn stantiation(AutowiredAnnotationBeanPostProcessor.j ava:243)
What am I doing wrong ??


Reply With Quote