Post a Job  |   Ask a Question?   |   Already registered? login or register
Manohar Mullagura
14/04/2016 04:50 PM

Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'semester1' defined in class path resource [com/cdi/common/application-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.util.List]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?


What is the wrong with the code? Semester.java
application-context.xml
CollectionInjectionTest.java
Spam    7 Comments

Ashwini,Dawat
14/04/2016 18:08:27
You should probably remove the name attribute in [<constructor-arg name="subjects"] as you are not using @ConstructorProperties for the constructor. Please remove name attribute from <constructor-arg> and try.

Bisnu,Gochhayat
14/04/2016 20:51:22
remove the name attribute in [<constructor-arg name="subjects"] from application-context.xml file and also remove super(); from Subject.java constructor and try . it will be work properly

Bisnu,Gochhayat
14/04/2016 20:53:08
sorry! Semester.java file

Mamatha,Reddy
14/04/2016 22:34:38
but it giving error plz anyone can tell me what is the problem

Praveen,Jaish
15/04/2016 01:17:41
you must be remove the name attribute of <constructor-arg name="subjects"/> You should write the following code which is given below:--->

siva,reddy
21/04/2016 00:17:01
Without changing the code, just write the @ConstructorProperties("subjects") in public Semester(List<String> subjects)...it will be work..@

Manohar,Mullagura
29/04/2016 22:55:31
thank you

Languages :
xml