NullPointerException causes application deployment to fail
 Technote (FAQ)
 
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
  1. Expand the EAR using earexpander, which is located in Install-Root /bin/earexpander.sh.

  2. Remove the unmatching Resource Ref in the ibm-ejb-jar-bnd.xmi, or define the matching Resource Ref in ejb-jar.xml file.

  3. Use earexpander to collapse the EAR.

  4. Redeploy the ear.
 
SystemErr.txt
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Deploy (for example: AAT or ANT or EAR/WAR/JAR)
Operating system(s): Windows
Software version: 5.1.1
Software edition:
Reference #: 1178192
IBM Group: Software Group
Modified date: Aug 30, 2004