Error Logs๐Ÿพ

[Spring] javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotBlank'

hae02y 2023. 7. 10. 00:13
๋ฐ˜์‘ํ˜•
    @NotBlank
    @Email
    private String email;

    @NotBlank(message = "์ด๋ฆ„์€ 1๊ธ€์ž ์ด์ƒ ์ž…๋ ฅ๋˜์•ผํ•ฉ๋‹ˆ๋‹ค.")
    private String name;

    @Pattern(regexp = "^010-\\d{3,4}-\\d{4}$",
            message = "ํœด๋Œ€ํฐ ๋ฒˆํ˜ธ๋Š” 010์œผ๋กœ ์‹œ์ž‘ํ•˜๋Š” 11์ž๋ฆฌ ์ˆซ์ž์™€ '-'๋กœ ๊ตฌ์„ฑ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.")
    private String phone;

    @NotBlank
    private long password;

์œ„์™€ ๊ฐ™์ด Post์š”์ฒญ์— ๋Œ€ํ•œ DTO๋ฅผ ๊ตฌ์„ฑํ•˜์˜€๋Š”๋ฐ Post ์š”์ฒญ์‹œ์— ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค.

javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotBlank'

์ฐพ์•„๋ณด๋‹ˆ longํƒ€์ž… ,intํƒ€์ž…๋“ฑ์˜ ๊ธฐ๋ณธ ์ˆซ์žํƒ€์ž…์— ๋Œ€ํ•ด์„œ๋Š” @NotBlank ์• ๋„ˆํ…Œ์ด์…˜์„ ์‚ฌ์šฉํ• ์ˆ˜์—†๊ณ  ๋งŒ์•ฝ ์œ ํšจ์„ฑ๊ฒ€์‚ฌ๊ฐ€ ํ•„์š”ํ•˜๋‹ค๋ฉด @Min, @Max๋“ฑ์˜ ์ตœ์†Œ, ์ตœ๋Œ€๊ฐ’์„ ์ง€์ •ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•˜๋‹ค๊ณ  ํ•œ๋‹ค. ํ•ด๋‹น ๋ถ€๋ถ„์„ ์ˆ˜์ •ํ•˜๊ณ  ๋‚˜๋‹ˆ ์ •์ƒ๋™์ž‘ ํ•˜์˜€๋‹ค.

 

 

๋ฐ˜์‘ํ˜•