java.lang.NoSuchMethodException: userAuth.User.()

前端 未结 4 1558
小蘑菇
小蘑菇 2020-12-10 00:13

I have the class with validation:

public class User {
    @Size(min=3, max=20, message=\"User name must be between 3 and 20 characters long\")
    @Pattern(r         


        
4条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 00:49

    The message java.lang.NoSuchMethodException: userAuth.User.() means that someone tried to call a constructor without any parameters. Adding a default constructor should solve this problem:

    public class User {
    
        public User() {
    
        }
    
        ..
    }
    

提交回复
热议问题