Validation异常:No validator could be found for constraint '.....' validating type 'java.lang.Integer'.
-
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.Pattern' validating type 'java.lang.Integer'. Check configuration for 'sortType'
-
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.throwExceptionForNullValidator(ConstraintTree.java:227) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorNoUnwrapping(ConstraintTree.java:308) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorInstanceForAutomaticUnwrapping(ConstraintTree.java:242) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getInitializedConstraintValidator(ConstraintTree.java:163) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:116) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:87) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:73) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:616) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:581) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForSingleDefaultGroupElement(ValidatorImpl.java:527) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:495) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:460) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:410) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:207) ~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
-
at com.sf.ioms.common.utils.ValidateUtil.validateModel(ValidateUtil.java:36) ~[ioms-common-1.0.0.jar:?]
-
at com.sf.ioms.api.support.AcceptDataProcessor.processData(AcceptDataProcessor.java:37) [ioms-api-service-0.0.1-SNAPSHOT.jar:?]
-
at com.sf.ioms.api.web.controller.AcceptDataController.process(AcceptDataController.java:63) [classes/:?]
-
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_172]
-
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_172]
-
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_172]
-
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_172]
-
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) [spring-web-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) [spring-web-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) [spring-webmvc-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) [spring-webmvc-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) [spring-webmvc-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) [spring-webmvc-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) [spring-webmvc-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) [spring-webmvc-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) [spring-webmvc-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) [spring-webmvc-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [javax.servlet-api-3.1.0.jar:3.1.0]
-
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) [spring-webmvc-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]
-
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800) [jetty-servlet-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) [jetty-servlet-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at com.sf.ioms.api.web.filter.XSSFilter.doFilter(XSSFilter.java:37) [classes/:?]
-
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.15.RELEASE.jar:4.3.15.RELEASE]
-
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) [jetty-servlet-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) [jetty-security-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) [jetty-servlet-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.Server.handle(Server.java:497) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245) [jetty-server-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) [jetty-io-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) [jetty-util-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) [jetty-util-9.2.7.v20150116.jar:9.2.7.v20150116]
-
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]
异常原因:项目中使用的校验注解所支持的数据类型与实体中字段的类型不符合。
例:在Integer类型的字段上使用@NotEmpty,@NotEmpty支持的是字符串类型字段,这样子使用肯定是会报错的。
解决方法:换个校验注解,或者不使用校验注解
例: 将Integer类型的字段上使用的@NotEmpty换成@NotNull
希望此文能够帮助到您!
原文地址:https://blog.csdn.net/king_qc/article/details/81390396
Validation异常:No validator could be found for constraint '.....' validating type 'java.lang.Integer'.的更多相关文章
- org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.Integer
使用hibernate时,在save方法时,报了:org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.In ...
- HV000030: No validator could be found for type: java.lang.Integer.
在写接口时,一般去查找在类的Integer属性上加了不属于整型的校验,比如@NotEmpty,@Length等 @JSONField(name = "deviceNum") @No ...
- RestTemplate异常no suitable HttpMessageConverter found for request type [java.lang.Integer]
GET方式,参数必须放在URL后面,http://xxx/list?name={name}&age={age} package com.chelizi.xiruo.xframework.uti ...
- javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.Size' validating type 'java.util.Date'.
开始是 javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Intege ...
- 异常:failed for object com.sdu.crm.pojo.Customer@136a986 [java.lang.NullPointerException]
异常: failed for object com.sdu.crm.pojo.Customer@136a986 [java.lang.NullPointerException] 大家好,如果大家看到了 ...
- Java 异常 Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date'
查询时发送给服务器的日期的字符串格式:yyyy-MM-dd HH:mm:ss 服务器接收到日期的字符串之后,向 MySQL 数据库发起查询时,因为没有指定日期时间格式,导致字符串数据不能正确地转换为日 ...
- hibernate.validator.constraints.NotEmpty校验请求参数报错java.lang.NoClassDefFoundError: javax/el/PropertyNotFoundException
spring maven项目,使用hibernate validator 注解形式校验客户端的请求参数. hibernate-validator版本:5.0.2.Final validation-ap ...
- Android异常:唤醒锁未授权。(Caused by: java.lang.SecurityException: Neither user 10044 nor current process has android.permission.WAKE_LOCK.)
Android异常:Caused by: java.lang.SecurityException: Neither user 10044 nor current process has android ...
- 34 异常机制 异常体系结构 Java把异常当做对象来处理 并定义一个基类java.lang.Throwable作为所有异常的超类 Error Exception
异常体系结构 概念 Java把异常当做对象来处理,并定义一个基类java.lang.Throwable作为所有异常的超类. 在Java API中已经定义了许多异常类,这些异常类分为两大类,错误Erro ...
随机推荐
- [转]C#接收邮件
最近由于工作需要,接触到了邮件服务器.以前我用CF写过,感觉没有什么,我想用C#来实现会更简单,但是万万没想到C#没有提供邮件接收的方法,令我很不解.通过我在网上查找,发现了一个国外公司写好的接收邮件 ...
- VC++1.5太伟大了
功能样样俱全,一点不比现在的VS系列差 VC++1.5全貌,虽然很古老,但是已经可以了. 新建的文档试图,多文档工程,很像样 文档试图,单文档工程,已经非常像样了,和记事本差不多了 这是资源编辑器,寒 ...
- 关于SQL查询效率 主要针对sql server
1.关于SQL查询效率,100w数据,查询只要1秒,与您分享:机器情况p4: 2.4内存: 1 Gos: windows 2003数据库: ms sql server 2000目的: 查询性能测试,比 ...
- 用windows命令解压chm文件
Windows里有这样一个工具:hh.exe.hh.exe最重要的功能就是用来关联CHM文件,当你运行一个chm文件的时候,系统就是用这个工具来打开的. 其实它还有另外一个功能——解压CHM文件在CM ...
- javascript基础:dom
Dom: * 概念:Document Object Model 文档对象模型 * 将标记语言文档的各个组成部分,封装成对象,可以使用这些对象,对标记语言文档进行CRUD的动态操作 * D ...
- workbench使用
1.你是指默认的mysql目录下data里面的'mysql'这个schema没有在workbench里面看到吧?点击菜单-Edit->Preferences里面的SQL Editor,然后把&q ...
- Redis源码解析:28集群(四)手动故障转移、从节点迁移
一:手动故障转移 Redis集群支持手动故障转移.也就是向从节点发送"CLUSTER FAILOVER"命令,使其在主节点未下线的情况下,发起故障转移流程,升级为新的主节点,而原 ...
- 使用koa-body中间件后DELETE请求中ctx.request.body内容为空
gitbook浏览此随笔 出现场景 在使用koa-body 做文件上传的时候,发现使用DELETE请求时,request.body中的内容为空对象{} app.js //code... const K ...
- git与github建立链接(将本次项目与网络GitHub同步) --转存笔记
转载自:https://blog.csdn.net/qq_36529459/article/details/79047220 1.(先进入项目文件夹)通过命令 git init 把这个目录变成git可 ...
- div style标签内嵌CSS样式
我们在DIV标签内.SPAN标签内.p标签等html标签内使用style属性直接设置div的样式. 一.在<div>标签内使用style设置css样式 - TOP 1.实例html ...