javax.validation.ConstraintViolationException

javax.validation.ConstraintViolationException 
... 71 more
Caused by: javax.validation.ConstraintViolationException: validation failed for
classes [cn.com.softvan.travelb2b.domain.TravelLine] during persist time for gro
ups [javax.validation.groups.Default, ]

就是在实体的get方法中添加了Validate校验,但是在update和保存时没有调用hibernate的validate校验,仍然会报以上错误,并且会去校验。解决办法是在hibernate.property配置文件中添加这样一句:

avax.persistence.validation.mode=none

就可以解决。

时间: 2024-11-11 01:00:22

javax.validation.ConstraintViolationException的相关文章

javax.validation 自定义校验器

import java.util.Iterator; import java.util.List; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import org.apache.commons.lang3.StringUtils; public class ListStringPatternValidator implements Constra

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]验证

package main; import java.util.Set; import javax.validation.ConstraintViolation; import javax.validation.Validation; import javax.validation.Validator; import javax.validation.ValidatorFactory; import javax.validation.constraints.Max; import javax.va

Exception in thread "main" javax.validation.ValidationException: Unable to find a default provider

Exception in thread "main" javax.validation.ValidationException: Unable to find a default provider 在使用Spring MVC+Mybatis整合的时候出现上面的问题 要将下面三个包加入项目的BuildPath中才行:    hibernate-validator-4.2.0.Final.jar    validation-api-1.0.0.GA.jar    slf4j-api-1.6

javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found

1 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; nested exception is javax.validation.ValidationExc

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

[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: ja

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

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

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博主「无名_四叶草」的原创文章,遵循