org.springframework.beans.BeanInstantiationException: Failed to instantiate [demo.Words]: No default

Posted mljqqh

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了org.springframework.beans.BeanInstantiationException: Failed to instantiate [demo.Words]: No default相关的知识,希望对你有一定的参考价值。

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

 

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

解决方法:

要么不设置构造函数;

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



以上是关于org.springframework.beans.BeanInstantiationException: Failed to instantiate [demo.Words]: No default的主要内容,如果未能解决你的问题,请参考以下文章

REST API:org.springframework.beans.factory.UnsatisfiedDependencyException:

Spring security-org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.sec

org.springframework.beans.factory.UnsatisfiedDependencyException:

没有实现 [org.springframework.beans.factory.xml.NamespaceHandler] 接口

Spring Boot 错误 org.springframework.beans.factory.UnsatisfiedDependencyException

org.springframework.beans.factory.UnsatisfiedDependencyException:创建 bean 时出错