使用Spring报错:No default constructor found;

Exception in thread "main" org.springframework.beans.factory.BeanCreationException:

Error creating bean with name 'CustomerBean' defined in class path resource [Spring-Customer.xml]:

Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.yiibai.common.Customer]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.yiibai.common.Customer.()

使用Spring注解时要提空默认的构造函数

提供默认的构造函数就好了。

posted @ 2018-03-15 13:32  Lost blog  阅读(6043)  评论(0编辑  收藏  举报