cancel
Showing results for 
Search instead for 
Did you mean: 

Problem looking up entity local home - ejb-local-ref

0 Kudos
198

Hi,

I have an application with a session bean (MetaManager) and an entity bean (InfoItem) which I want to reference from that session bean. The entity

bean is deployed correctly, but I simply cannot look it up locally from the session bean (the remote lookup works alright).

I use the following code for the lookup:

Context initial = new InitialContext();

InfoItemLocalHome home = (InfoItemLocalHome)initial.lookup("sap.com/ejb/InfoItemLocal");

The following exception is thrown:

com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of InfoItemLocal.

In ejb-jar.xml I have specified MetaManagerBean as follows:

<session>

<ejb-name>MetaManagerBean</ejb-name>

<home>com.sap.promise.rhl.ssb.MetaManagerHome</home>

<remote>com.sap.promise.rhl.ssb.MetaManager</remote>

<local-home>com.sap.promise.rhl.ssb.MetaManagerLocalHome</local-home>

<local>com.sap.promise.rhl.ssb.MetaManagerLocal</local>

<ejb-class>com.sap.promise.rhl.ssb.MetaManagerBean</ejb-class>

<session-type>Stateless</session-type>

<transaction-type>Container</transaction-type>

<ejb-local-ref>

<ejb-ref-name>InfoItemLocal</ejb-ref-name>

<ejb-ref-type>Entity</ejb-ref-type>

<local-home>com.sap.promise.rhl.entity.InfoItemLocalHome</local-home>

<local>com.sap.promise.rhl.entity.InfoItemLocal</local>

<ejb-link>RhlEjb.jar#InfoItemBean</ejb-link>

</ejb-local-ref>

</session>

In ejb-j2ee-engine.xml I have specified:

<enterprise-bean>

<ejb-name>MetaManagerBean</ejb-name>

<jndi-name>sap.com/ejb/MetaManager</jndi-name>

<ejb-local-ref>

<ejb-ref-name>InfoItemLocal</ejb-ref-name>

<jndi-name>sap.com/ejb/InfoItemLocal</jndi-name>

</ejb-local-ref>

<session-props/>

</enterprise-bean>

The error occurs regardless of whether I use

"InfoItemLocal" (as specified as the ejb-ref-name) or

"sap.com/ejb/InfoItemLocal" (jndi-name).

I simply cannot do a local lookup. Anybody has an idea of what I'm doing wrong?

Thanks alot for your help!

View Entire Topic
0 Kudos

Hi Maksim,

Your solution worked fine, thanks alot! Still, I do not understand why mine didn't do.. 😕

Regards,

Katrin.