在學習Spring過程中使用類型獲取對象出現以下錯誤:org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atguigu.pojo.Person' available: expected single matching bean but found 2: p1,p2
原因分析
這是因為配置文件中有兩個相同數據類型的bean對象了,不能使用類型獲取對象的方式,故而最好使用獲取id獲取對象。