We noticed the same problem, particularly with Java EL and JPA. This is likely to affect multiple frameworks that use Introspector to discover properties that follow the JavaBean convention.
There is an official Bug opened. I thought I would add this for reference since it is creating problems for multiple frameworks.
The official Fix version is 21. I asked if it could possibly be backported to 17.
EDIT
More Info for EL specific issues: https://github.com/jakartaee/expression-language/issues/43
There may be at least a partial fix in Jakarta EE 10.
However, there is a fully working workaround for EE < 10 and JDK < 21. You can simply make a BeanInfo
class that describes the properties inherited from the interface. Here, MyClass
is inheriting aProperty
getter/setters from an interface. To expose these to the JDK Introspector, simply create a BeanInfo
class:
public class MyClassBeanInfo extends SimpleBeanInfo {
@Override
public BeanInfo[] getAdditionalBeanInfo() {
return new BeanInfo[] { new SimpleBeanInfo() {
@Override
public PropertyDescriptor[] getPropertyDescriptors() {
try {
return new PropertyDescriptor[] { new PropertyDescriptor("aProperty", MyClass.class, "getAProperty", "setAProperty") };
} catch (final IntrospectionException e) {
throw new RuntimeException(e);
}
}
} };
}
}
Reference: https://docs.oracle.com/javase/8/docs/api/java/beans/BeanInfo.html