那些@notempty @size @max等等都无效,org.hibernate.validator.constraints这个路径里的,以前用3.1的时候是这个路径org.hibernate.validator没和别的包冲突,而4.1版本org.hibernate.validator.constraints不知道和谁冲突,反正我就是删除hibernate-validator-4.1.0.Final.jar后它照样没报错,没加jar包还是有这个路径,不知道是哪里的包。搞半天搞不懂,谁有经验的指点一下啊,好乱哦
------解决思路----------------------
把你的验证方法发出来,我4.2都用了快一年了,我不清楚你是不是这么验证的,如果是,就是倒错包了,请你试下这个注解javax.validation.constraints.Size,如果没用,当我没说
Set<ConstraintViolation<T>> violations = violations = validator.validate(req, Default.class,
req.getValidatorGroup());