I had a similar problem when using the Jakarta @Valid annotation in the controller. In this case, only Jakarta validations worked. But if you use the @Validated annotation, then both Spring and Jakarta annotations will work
@Valid
@Validated