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

[java] view
plain
copyprint?

  1. Apr 8, 2014 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 会出现上面的错

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

时间: 2024-10-27 05:47:26

javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer的相关文章

javax.el.PropertyNotFoundException: Property 'id' not found on type java.lang.Integer

javax.el.PropertyNotFoundException: Property 'id' not found on type java.lang.Integer    at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:237)    at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:214)    at jav

javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 解决方法

在使用hibernate validator进行参数有效性校验的时候,我们有时候会遇到javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint ,比如,在我们的应用中,使用了自定义注解Dict对枚举进行有效性校验,因为定义的Dict应用于String类型,例如: package com.yidoo.base.metadata.validate; import jav

javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint

使用hibernate validator出现上面的错误, 需要 注意 @NotNull 和 @NotEmpty  和@NotBlank 区别 @NotEmpty 用在集合类上面@NotBlank 用在String上面@NotNull    用在基本类型上 如果在基本类型上面用NotEmpty或者NotBlank 会出现上面的错 http://blog.csdn.net/dracotianlong/article/details/23181729 javax.validation.Unexpec

javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint,NotBlank判断不能为空

java 验证出现如下错误: javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint错误原因      Java实体类中属性是Integer类型,用了NotBlank判断不能为空,而这个注解是判断字符串是否为空 3.解决办法 去掉@NotBlank注解.使用@NotNull————————————————版权声明:本文为CSDN博主「无名_四叶草」的原创文章,遵循

版本不匹配引发的血案:javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint

发现一个API报了错: javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'. Check configuration for 'cancelReason' at org.hibernate.validator.i

javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String

javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193) javax.el.BeanELResolver.property(BeanELResolver.java:267) javax.el.BeanELResolver.getValue(Bean

Caused by: javax.el.PropertyNotFoundException: Property 'product' not found on type java.lang.String

今天在JSP利用EL表达式取值报了 "javax.el.PropertyNotFoundException”,经过debug和打印将问题定位到这段代码: HTML应该是没啥问题,看提示在java.lang.string类型上找不到属性“product”,应该是EL表达式哪里写错了,然后将图中EL表达式重新写了一遍: 然后神奇的不报错了,搞得我一脸蒙蔽,我将每段代码都比对了一下,没发现哪里不对,干就干彻底,替换每段代码测试,结果第一段替换进去就OK了 仔细检查了两段代码: //报错代码 <c

Caused by: javax.el.PropertyNotFoundException: Property [userName] not found on type [java.lang.String]

Caused by: javax.el.PropertyNotFoundException: Property [userName] not found on type [java.lang.String] at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:260) at javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:21

spring boot中使用javax.validation以及org.hibernate.validator校验入参

这里springboot用的版本是:<version>2.1.1.RELEASE</version> 自带了hibernate.validator,所以不用添加额外依赖 1.创建个对应前台form的测试vo,并添加字段校验注解 import java.math.BigDecimal; import java.util.Date; import java.util.List; import javax.validation.constraints.AssertTrue; import