先贴段日志
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint BillCommonSaveTool'javax.validation.constraints.Size' validating type 'java.lang.Double'. Check configuration for 'pledgeeAmt'
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.throwExceptionForNullValidator(ConstraintTree.java:228)
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorNoUnwrapping(ConstraintTree.java:309)
刚看到这段日志的时候以为是有长度的校验,查看代码发现pledgeeAmt
为Double
且并没有关于长度的校验。
@NotEmpty(message = "{bill.common.pledgeeAmt.isRequired}")
private Double pledgeeAmt;
纳闷日志怎么会报javax.validation.constraints.Size
,发现pledgeeAmt
是Double
类型,而注解使用的是@NotEmpty
。