Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.7.4
-
None
Description
If I add a property getter into a resourceadapter-class or into a managedconnectionfactory-class, when deploying I get a NPE, since it expects the setter to be there. The deployed classes are available, but configuration might not be loaded properly since the configuration load is interrupted by the NPE. I had a look into the spec, and yes for config properties you are required to have a getter / setter, but I couldn't find anything telling you that you can't have a regular property with just a getter (it's just not configurable).
Caused by:
javax.resource.spi.ConfigProperty annotation = propertyDescriptor.getWriteMethod().getAnnotation(javax.resource.spi.ConfigProperty.class);
Either needs a null check in getWriteMethod, or just ignore properties without a setter.
Stacktrace:
java.lang.NullPointerException at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.process(AnnotationDeployer.java:858) at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:772) at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:460) at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:356) at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:403) at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:971) at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:801) at org.apache.tomee.embedded.Container.deploy(Container.java:414) at org.apache.tomee.embedded.Container.deploy(Container.java:392)
Workaround:
Add setter to all the properties, even if you don't need them.