bug: IntrospectionException-Method not found anomalies lombok

Exception information

java.beans.IntrospectionException: Method not found: setName
    at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:111)
    at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:71)

Scenes

  • Use new PropertyDescriptor(propertyName, clazz);reflective get attributes describe the object
  • Entity classes use lombok
    <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.18</version> </dependency>

the reason

  • The reason is that the entity class uses the @Accessors(chain = true)annotation
  • The annotation object such setter method returns the object itself, in order to use the chain
  • new PropertyDescriptor(propertyName, clazz); Requirements setter return value void
  • Solution: remove @Accessors(chain = true)notes to

Guess you like

Origin www.cnblogs.com/noodlerkun/p/11770908.html