admin管理员组

文章数量:1398840

Using Spring Boot 3.3, I am trying to do this

import .springframework.boot.context.properties.ConfigurationProperties;
import .springframework.validation.annotation.Validated;

@Validated
@ConfigurationProperties("blah")
public record Blah(int foo) {
}

However, this fails with:

Caused by: .springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.example.Blah: Common causes of this problem include using a final class or a non-visible class

It works without @Validated. Is this combination not possible with records?

本文标签: javaSpring Boot 33 Validated ConfigurationProperties fails with AopConfigExceptionStack Overflow