Hi,
I am trying to use an EJB from a web dynpro application. The EJB is given a name as "MaterialBatchBean" as follows:
<ejb-j2ee-engine>
<description>
</description>
<enterprise-beans>
<enterprise-bean>
<ejb-name>MaterialBatchBean</ejb-name>
<jndi-name>MaterialBatchBean</jndi-name>
<entity-props/>
</enterprise-bean>
</enterprise-beans>
</ejb-j2ee-engine>
When I try to look up this EJB using the following codes, it always complains about the incorrect path:
InitialContext ctx = new javax.naming.InitialContext();
MaterialBatchHome mbHome = (MaterialBatchHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/ejb/MaterialBatchBean"),MaterialBatchHome.class);
Does anyone know what is wrong here? Your help is appreciated!
Hart
Hi Hart,
You can check the exact path of your EJB from the Visual Admin. In the Visual Admin, go to service EJB Container -> Beans. Then drill down to your ejb project and your ejb. You can then see the path from the JNDI Name field on the right.
Also, rememeber that you need to set the reference to this EJB from your Web Dynpro project properties when you lookup ejb from your code implementation and not using model.
Regards,
Marc
Add a comment