I have a member in my class:
Class Abc
{
...
@Autowired
Set<TestClass> testClasses;
...
}
How can I inject it using Spring?
The xml I am using is:
<bean id="testClasses" class="java.util.HashSet"/>
I am injecting an empty bean because I want it to be an empty set of TestClass types.
But it’s giving me the following error:
No matching bean of type [TestClass] found for dependency [collection
of TestClass].
Am I doing anything wrong here?
or
Adding qualifier solves the problem as there might be multiple
Set<TestClass>types available.