[java] view
plaincopyprint?
- Apr 8, 2014 2:13:57 PM org.apache.catalina.core.StandardWrapperValve invoke
- SEVERE: Servlet.service() for servlet springmvc threw exception
- javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer
- at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:383)
- at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:364)
- at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:313)
- at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:144)
- at org.hibernate.validator.engine.ConstraintTree.validateComposingConstraints(ConstraintTree.java:233)
- at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:128)
- at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:117)
- at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:84)
- at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:452)
使用hibernate validator出现上面的错误, 需要 注意
@NotNull 和 @NotEmpty 和@NotBlank 区别
- @NotEmpty 用在集合类上面
- @NotBlank 用在String上面
- @NotNull 用在基本类型上
如果在基本类型上面用NotEmpty或者NotBlank 会出现上面的错
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-27 05:47:26