Reputation: 103
Environment - WAS 7.0 and EJB 2.1
I have a EAR with EJB jar file. It has some remote EJB's (EJB 2.1) that I want to convert to local EJB. Hence i had to modify ejb-jar.xml as per my understanding.
My modified ejb-jar xml file is as follows:
<ejb-jar id="ejb-jar_ID" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
....
...
<session id="Manager">
<ejb-name>Manager</ejb-name>
<home>com.aa.bb.ManagerHome</home>
<remote>com.aa.bb.ManagerRemote</remote>
<ejb-class>com.aa.bb.Manager</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<local-home>com.aa.bb.ManagerLocalHome</local-home>
<local>com.aa.bb.ManagerLocal</local>
<ejb-local-ref id="EJBLocalRef_1139997836094">
<ejb-ref-name>ejb/ManagerLocalHome</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.aa.bb.ManagerLocalHome</local-home>
<local>com.aa.bb.ManagerLocal</local>
<ejb-link>Manager</ejb-link>
</ejb-local-ref>
, and are newly added tags for the local ejb.
And my Bindings file is as follows -
<ejbbnd:EJBJarBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejb="ejb.xmi" xmlns:ejbbnd="ejbbnd.xmi" xmi:id="EJBJarBinding_1107442316219">
<ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/>
.....
.....
<ejbBindings xmi:id="EnterpriseBeanBinding_1142021363669" jndiName="ejb/ManagerLocalHome">
<enterpriseBean xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#Manager"/>
<resRefBindings xmi:id="ResourceRefBinding_1315855161720" jndiName="OraDataSource">
<bindingResourceRef href="META-INF/ejb-jar.xml#ResourceRef_1142023723001"/>
</resRefBindings>
</ejbBindings>
During deploy of the EAR file I get the following error -
com.ibm.websphere.management.application.client.AppDeploymentException:
ADMA0014E: Validation failed. ADMA0007E: A Validation error occurred in task Mapping EJB references to enterprise beans.
The Java Naming and Directory Interface (JNDI) name is not specified for reference binding ejb/ManagerLocalHome in module ZZZZZ with EJB name Manager.
Any idea why it would complain about JNDI when it has been defined ? Am I missing something?
Upvotes: 0
Views: 1181
Reputation: 103
It seems like the jndiName should jndiName="ejb/Manager" in the bindings file and it started working for me. Had to run it rhought rmic but the lookup is now working.
Upvotes: 0