I am using Java 17 and Spring Boot Starter 3.2.2. I tried to use Javassist 3.22.0-GA so that I can create dynamic classes. A simple code was tested where ctClass was created , a single field of type string is added and a default constructor is added. But ctClass.toClass() always throws java.lang.NullPointerException cannot invoke java.lang.reflect.field.setaccessible(boolean) because ao is null. Does it have to do with Javassist version here to solve this issue?
Comment From: bclozel
I don't think this is related to Spring at all. We don't have any integration nor usage of Javassist that I know of in Spring Framework. Maybe ask a question on StackOverflow by sharing a minimal sample application?