-
1. Re: Binding Local Interfaces to JNDI Problem
spieler Sep 13, 2002 10:22 AM (in response to prasanna)Hi,
since I currently only understand have of what I am doing here, but I think I just solved your problem (because it was mine too until some hours ago).
You have to do two things:
- declare that the EJB has a local interface
- declare that your bean want to use the other bean
wiht the descriptors below I was able to retrieve a Local home interface in the session bean like this:
InitialContext context = new InitialContext();
PropertyLocalHome propertyLocalHome
= (PropertyLocalHome)context.lookup( "java:comp/env/ejb/evaluator/PropertyLocal" );
I did it with XDoclet, below is what it generate in the ejb-jar.xml (it's for a session bean using an entity bean, but I hope it helps anyway):
--- this is from the deployment description of the EJB:
[...]
[...]
<local-home>de.lineas.evaluator.interfaces.EvaluationLocalHome</local-home>
de.lineas.evaluator.interfaces.EvaluationLocal
[...]
[...]
---- this is in the bean descriptor which wants to use the local interface: -----
[...]
[...]
<ejb-local-ref>
<ejb-ref-name>ejb/evaluator/EvaluationLocal</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>de.lineas.evaluator.interfaces.EvaluationLocalHome</local-home>
de.lineas.evaluator.interfaces.EvaluationLocal
<ejb-link>evaluator/Evaluation</ejb-link>
</ejb-local-ref>
[...]
[...]
Have fun
Spieler