当前位置: 代码迷 >> 综合 >> No default constructor found; nested exception is java.lang.NoSuchMethodException
  详细解决方案

No default constructor found; nested exception is java.lang.NoSuchMethodException

热度:64   发布时间:2023-09-20 00:13:54.0

类中显示声明有参构造方法后,必选显示声明一个无参构造方法,否则报以下错误:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.xxx.elasticsearch.util.EsUtil]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.xxx.elasticsearch.util.EsUtil.<init>()

  相关解决方案