का कोई अद्वितीय सेम मैं एक सेवा के दो घटक के साथ वसंत में एक छोटे से परेशानी है।स्प्रिंग प्रकार
@Component
public class SmartCardWrapper
और यह एक:
मैं इस घटक है
@Component
public class DummySmartCardWrapper extends SmartCardWrapper
सेवा autowire दोनों लेकिन वसंत इस expection कारण विफल रहता है:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.cinebot.smartcard.SmartCardWrapper] is defined: expected single matching bean but found 2: [dummySmartCardWrapper, smartCardWrapper]
क्यों यह नहीं है कक्षा के नाम का प्रयोग करें?
हाय Tobia, लगता है कि आप, एनोटेशन @Qualifier का उपयोग करना चाहिए लिंक की जाँच करें: http: //static.springsource। org/वसंत/docs/2.5.x/संदर्भ/beans.html # सेम-एनोटेशन-config – Jaiwo99