码迷,mamicode.com
首页 > 编程语言 > 详细

javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer

时间:2015-07-15 13:16:30      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:

  1. Apr 82014 2:13:57 PM org.apache.catalina.core.StandardWrapperValve invoke  
  2. SEVERE: Servlet.service() for servlet springmvc threw exception  
  3. javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer  
  4.     at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:383)  
  5.     at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:364)  
  6.     at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:313)  
  7.     at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:144)  
  8.     at org.hibernate.validator.engine.ConstraintTree.validateComposingConstraints(ConstraintTree.java:233)  
  9.     at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:128)  
  10.     at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:117)  
  11.     at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:84)  
  12.     at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:452)  


使用hibernate validator出现上面的错误, 需要 注意

@NotNull 和 @NotEmpty  和@NotBlank 区别

  • @NotEmpty 用在集合类上面
  • @NotBlank 用在String上面
  • @NotNull    用在基本类型上


如果在基本类型上面用NotEmpty或者NotBlank 会出现上面的错

版权声明:本文为博主原创文章,未经博主允许不得转载。

javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer

标签:

原文地址:http://blog.csdn.net/lovesomnus/article/details/46891405

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!