I've tried everything i can think of to fix this error but spring cannot seem to differentiate between the base holdService and it's child activationHoldService.
@Component("ActivationHoldService")
public class ActivationHoldServiceImpl extends HoldServiceImpl {
@Component("BaseHoldService")
public class HoldServiceImpl implements HoldService {
@Component("com.erac.vos.webservice.hold.HoldWebServiceValidator")
public class HoldWebServiceValidator extends BaseValidator {
private static final Log LOG = LogFactory.getLog(
com.erac.vos.webservice.hold.HoldWebServiceValidator.class);
@Autowired
@Qualifier("BaseHoldService")
private HoldService holdService;
I'm trying to Autowire the HoldService but i keep getting the error message
could not autowire field: private com.erac.vos.service.vehicle.hold.HoldService com.erac.vos.webservice.vehicle.hold.HoldWebServiceValidator.holdService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.erac.vos.service.vehicle.hold.HoldService] is defined: expected single matching bean but found 2: [ActivationHoldService, BaseHoldService]
I've tried changing it to
@Resource(name="BaseHoldService",type=com.erac.vos.service.vehicle.hold.HoldServiceImpl.class)
Including excluding the quailifier and even switching the baseHoldService to a different name, and any combination of those things i can think of, to get it to work but it still cant find it. the strangest part is have a near identical line of code in a different class that works perfectly fine
@Resource(name="BaseHoldService",type=com.erac.vos.service.vehicle.hold.HoldServiceImpl.class)
private HoldService defaultHoldService;
Any Ideas whats going on?