Roberto Cortez created TOMEE-1817:
-------------------------------------

             Summary: java.lang.NullPointerException in Connector Resource 
Adapter deploy
                 Key: TOMEE-1817
                 URL: https://issues.apache.org/jira/browse/TOMEE-1817
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 1.7.4
            Reporter: Roberto Cortez
             Fix For: 1.7.5


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:
{code:java|title=org.apache.openejb.config.AnnotationDeployer}
javax.resource.spi.ConfigProperty annotation = 
propertyDescriptor.getWriteMethod().getAnnotation(javax.resource.spi.ConfigProperty.class);
{code}

Either needs a null check in getWriteMethod, or just ignore properties without 
a setter.

Stacktrace:
{code}
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)
{code}

Workaround:
Add setter to all the properties, even if you don't need them.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to