Hibernate validation error - @Size

微笑、不失礼 提交于 2019-12-02 01:15:46

I am surprised that any of the tests would work. Your exception indicates that you have the wrong version of the Unified Expressions Language dependencies on your classpath. See also https://github.com/hibernate/hibernate-validator and http://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#validator-gettingstarted-uel

I guess the question becomes in which environment you are running and which EL dependencies (if any) you are using.

I realize the post is bit old and probably resolved. Just wanted to updated anyway if someone else encounter the same issue. As Mufanu added in the comment this will resolve if we add message attribute in the annotation

@not null works fine without message

@Size(min = 5, max = 6, message = "size must be between 5 and 6")
private String password;

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!