这个错误的根源是因为我没有提供无参的构造函数 靠 搞得 浪费了我大概三个多小时的时间。。。。啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊。。。。。。。
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1a42792: defining beans [department,employee1,employee2,employee4]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'department' defined in class path resource [com/gwp/zcc/test/beans.xml]: Cannot resolve reference to bean 'employee1' while setting bean property 'empList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employee1' defined in class path resource [com/gwp/zcc/test/beans.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.gwp.zcc.domain.Employee]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.gwp.zcc.domain.Employee.<init>()
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1a42792: defining beans [department,employee1,employee2,employee4]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'department' defined in class path resource [com/gwp/zcc/test/beans.xml]: Cannot resolve reference to bean 'employee1' while setting bean property 'empList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employee1' defined in class path resource [com/gwp/zcc/test/beans.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.gwp.zcc.domain.Employee]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.gwp.zcc.domain.Employee.<init>()
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver