org.springframework.beans.BeanInstantiationException: Failed to instantiate [demo.Words]: No default constructor found; nested exception is java.lang.NoSuchMethodException: demo.Words.<init>()

org.springframework.beans.BeanInstantiationException: Failed to instantiate [demo.Words]:
No default constructor found; nested exception is java.lang.NoSuchMethodException: demo.Words.<init>()
或者是:

org.springframework.beans.BeanInstantiationException: Failed to instantiate [Daomain.User]: Is it an abstract class?; nested exception is java.lang.InstantiationException: Daomain.User

 

这个异常就是实体类的构造函数引起的  

解决方法:

要么不设置构造函数;

要么设置满参构造函数和空参函构造数;..

文章来自:https://www.cnblogs.com/mljqqh/p/9833563.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3