[
https://jira.jboss.org/jira/browse/EJBTHREE-1858?page=com.atlassian.jira....
]
Wolfgang Knauf updated EJBTHREE-1858:
-------------------------------------
Attachment: ResourceEnvRefNPE.jar
Full sampe, including code. Deployment to JBoss 5.1.0GA with updated EJB-plugin 1.1.7 will
fail.
NPE if in resource-env-ref no injection target is specified
-----------------------------------------------------------
Key: EJBTHREE-1858
URL:
https://jira.jboss.org/jira/browse/EJBTHREE-1858
Project: EJB 3.0
Issue Type: Bug
Affects Versions: 1.1.7
Reporter: Wolfgang Knauf
Attachments: ResourceEnvRefNPE.jar
If an ENC entry for java:/comp/EJBContext is declared and NO injection target is
specified, this results in a NPE.
<resource-env-ref>
<resource-env-ref-name>EnvNameOfSessionContext</resource-env-ref-name>
<resource-env-ref-type>javax.ejb.SessionContext</resource-env-ref-type>
<mapped-name>java:comp/EJBContext</mapped-name>
</resource-env-ref>
The exception is:
...
Caused by: java.lang.NullPointerException
at org.jboss.injection.InjectionUtil.createInjectors(InjectionUtil.java:105)
at org.jboss.injection.ResourceHandler.loadXmlResourceEnvRefs(ResourceHandler.java:227)
at org.jboss.injection.ResourceHandler.loadXml(ResourceHandler.java:343)
at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:597)
at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:434)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:543)
... 69 more
Looking at the code in ResourceHandler.loadXmlResourceEnvRefs, this is the only place
where the check "if(envRef.getInjectionTargets() != null)" is missing ;-).
I will attach a sample.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira