org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.Integer

论坛 期权论坛 脚本     
匿名技术用户   2021-1-2 17:33   11   0

在使用easypoi实现导入功能时报下错误:

Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6b1efc94]
11:36:48.689 ERROR cn.afterturn.easypoi.excel.imports.ExcelImportService 251 importExcel - excel import error , row num:0,obj:com..p.upsManage.bean.PortEntity@10ce1749[id=<null>,portName=1001,deviceType=<null>,deviceId=1,deviceName=<null>,iesDeviceId=<null>,stamp=<null>,owner=<null>,errorMsg=<null>,rowNum=1]
11:36:48.690 ERROR com.ieslab.iocp.upsManage.controller.UpsManageController 781 batchImportPort - javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.Integer'. Check configuration for 'deviceId' java.lang.RuntimeException: javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.Integer'. Check configuration for 'deviceId'
at cn.afterturn.easypoi.excel.imports.ExcelImportService.importExcel(ExcelImportService.java:252) ~[easypoi-base-3.2.0.jar:?]
at cn.afterturn.easypoi.excel.imports.ExcelImportService.importExcelByIs(ExcelImportService.java:418) ~[easypoi-base-3.2.0.jar:?]
at cn.afterturn.easypoi.excel.ExcelImportUtil.importExcelMore(ExcelImportUtil.java:100) ~[easypoi-base-3.2.0.jar:?]

原因是Integer类型不能使用validation的NotBlank注解

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP