Trying to create a map bean with prototype scope in config class
@Configuration
public class SpringConfig {
public SpringConfig() {
}
@Bean
@Scope("prototype")
public Map<String, Composite> getCompositesMap() {
return new LinkedHashMap<String, Composite>();
}
}
But spring complains
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.eclipse.swt.widgets.Composite] found for dependency [map with value type org.eclipse.swt.widgets.Composite]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)}
How does one define a prototype map bean using annotations only (no xml)?