---
title: "hibernate validator处理No validator could be found for type错误"
author: "cargoj"
date: "2013-04-01T14:12:16Z"
tags: []
categories: ["企业架构"]
slug: "hibernate-validator-no-validator-could-be-found-for-type"
draft: false
lastmod: "2013-04-01T14:12:59Z"
id: 1840030
url: "https://cargoj.iteye.com/blog/1840030"
---

原因在于被验证的类与类上注解规则不匹配，详细规则要查阅JSR-303具体实现的文档。

比如使用hibernate validator ，  java.lang.Integer没有Length验证，如果使用则会报错:javax.validation.UnexpectedTypeException No validator could be found for type: java.lang.Integer