What happens when we have 2 or more beans defined in beans.xml with same id?

What happens when we have 2 or more beans defined in beans.xml with same id?

Spring Framework

Exception in thread “main” org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 11 in XML document from file [C:\figworkspace\SpringLearning\src\conf\ch4\beans.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Attribute value “provider” of type ID must be unique within the document.

Caused by: org.xml.sax.SAXParseException: Attribute value “provider” of type ID must be unique within the document.

Add comment