|
Problem |
Enterprise application fails to deploy due to the
following exception in the adminconsole:
AppDeploymentException: [ADMA0093E: Unexpected exception occurred while
completing task MapResRefToEJB. Please check server machines FFDC for more
information.] java.lang.NullPointerException |
|
Cause |
The ResourceRef ID defined in the ibm-ejb-jar-bnd.xmi must
match the Resource-Ref ID in the ejb-jar.xml file.
Sample resRefBindings in ibm-ejb-jar-bnd.xmi
<resRefBindings xmi:id="ResourceRefBinding_1092423966789"
jndiName="jms/TM2OrderResponseConnectionFactory">
<bindingResourceRef
href="META-INF/ejb-jar.xml#ResourceRef_1092427065578"/>
</resRefBindings>
<resRefBindings xmi:id="ResourceRefBinding_1092423966790"
jndiName="jms/TM2OrderResponseQueue">
<bindingResourceRef
href="META-INF/ejb-jar.xml#ResourceRef_1092427065579"/>
</resRefBindings>
In the above example we can see resource reference
ResourceRef_1092427065578 and ResourceRef_1092427065579 . Both the
Resource Ref id's were missing in the ejb-jar.xml file.
Here is an example of what the Resource ref should look like in both the
ejb-jar.xml and
ibm-ejb-jar-bnd.xmi files.
In ibm-ejb-jar-bnd.xmi file :
<resRefBindings xmi:id="ResourceRefBinding_1092664658007"
jndiName="jdbc/tm2/db2_t">
<bindingResourceRef
href="META-INF/ejb-jar.xml#ResourceRef_1092664658007"/>
</resRefBindings>
In ejb-jar.xml file :
<resource-ref id="ResourceRef_1092664658007">
<description></description>
<res-ref-name>jdbc/tm2/db2_t</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
|
|
Solution |
- Expand the EAR using earexpander, which is located in
Install-Root /bin/earexpander.sh.
- Remove the unmatching Resource Ref in the ibm-ejb-jar-bnd.xmi, or
define the matching Resource Ref in ejb-jar.xml file.
- Use earexpander to collapse the EAR.
- Redeploy the ear.
|
|