添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Spring & SpringBoot

[SpringBoot Error] No validator could be found for constraint 'javax.validation.constraints.NotBlank' validating type 'java.lang.Integer' 에러 해결

min-dev 2023. 2. 6. 14:10

@NotBlank와 @NotEmpty 어노테이션은 문자열(String) 필드에만 적용가능하고, Integer 필드에는 @NotNull을 사용해야 한다!

⛔ 오류메세지

javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotBlank' validating type 'java.lang.Integer'.

https://stackoverflow.com/questions/5982741/validation-error-no-validator-could-be-found-for-type-java-lang-integer

Validation error: "No validator could be found for type: java.lang.Integer"

I am working on a project with Spring why do I keep getting the following error? javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer Here is my code:

stackoverflow.com