Code example for NoUniqueBeanDefinitionException

0
		String[] beanNames = getBeanNamesForType(requiredType);
		if (beanNames.length == 1) {
			return getBean(beanNames[0], requiredType);
		} 
		else if (beanNames.length > 1) {
			throw new NoUniqueBeanDefinitionException(requiredType, beanNames);
		} 
		else { 
			throw new NoSuchBeanDefinitionException(requiredType);
		} 
	} 
 
	@Override 
	public Object getBean(String name, Object... args) throws BeansException {
		if (args != null) {
			throw new UnsupportedOperationException(
					"StaticListableBeanFactory does not support explicit bean creation arguments"); 
		} 
		return getBean(name);
	} 
Contextual code suggestions in your IDE  Get Codota for Java