使用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注解时要提空默认的构造函数

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM