NoSuchMethodException ()


1. Question Description:

SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/newppms] threw exception [Request processing failed;

nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.cdv.ppms.web.model.PpmsUser]:

No default constructor found; nested exception is java.lang.NoSuchMethodException: com.cdv.ppms.web.model.PpmsUser.<init>()] with root cause
java.lang.NoSuchMethodException: com.cdv.ppms.web.model.PpmsUser.<init>()
    at java.lang.Class.getConstructor0(Class.java:2902)
    at java.lang.Class.getDeclaredConstructor(Class.java:2066)

2. Analysis:

   As the error message say , default constructor not found.

   It must be create Constructor with parameters but not create the Constructor with no parameters,

   so the default Constructor was covered.

3. Solution:

   Add the default Constructor with no parameters.


免责声明!

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



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