I have two EJB modules (two JARs) deployed on BEA WebLogic 7.0. The first module contains session bean, and the other one contains entity bean. Entity bean has local interfaces and I want to lookup it from the session bean. It is OK when I have EAR archive, but it is not when I have separately deployed EJB modules. I would like to have possibility to lookup entity bean on the former way too, because it is more convenient in the development phase.
Can somebody help me?
In the problematic situation the following message occurs:
javax.naming.LinkException: . Root exception is javax.naming.LinkException: . Root exception is javax.naming.NameNotFo
undException: Unable to resolve 'app/ejb/entities.jar#EMMExpert/local-home' Resolved: 'app/ejb' Unresolved:'entities.jar
#EMMExpert' ; remaining name 'entities.jar#EMMExpert/local-home'
You should be able to do so if you have put the ejb ref in the deployment descriptors
(ejb-jar.xml and weblogic-ejb-jar.xml). Here is the samples for references:
ejb-jar.xml:
<ejb-ref>
<ejb-ref-name>ejb/entityBean01</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>com.examples.EntityBeanHome</home>
<remote>com.examples.EntityBean</remote>
<ejb-link>ejb.EntityBeanHome</ejb-link>
</ejb-ref>
weblogic-ejb-jar.xml:
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>ejb/entityBean01</ejb-ref-name>
<jndi-name>ejb.EntityBeanHome</jndi-name>
</ejb-reference-description>
</reference-descriptor>
Give it a try and good luck,
Eddie
Pay attention that my entity bean has local interfaces and it is deployed separately
(entities.jar). I want to access it from the session bean from the other module
deployed separately (manageexperts.jar) on the same weblogic server. I don't have
EAR archive (when I have EAR the problem disappears but because of development
process I want keep them deployed separately) - so, I don't have the same application.
The way you suggest doesn't help because you say that I should put <ejb-ref> with
appropriate <ejb-link> value (JNDI name). But, such value for ejb-link is not
recognized because it is outside my module that contains session bean. I also
tried something like this: <ejb-link>entities.jar#EMMExpert</ejb-link> with the
same result. Also, I think that for <ejb-ref> it is NOT ALLOWED to have local
and local home interfaces as you suggest.
Regards, Tihomir