Pedro Salazar wrote:
> The problem I verify here is when I have hard-coded a jndi 
> call in my code!! The specific tags for each container I replace with 
> ${jndi-jboss} or ${jndi-weblogic}, so they aren't a problem.
> 
> "
> javax.sql.DataSource ds=(javax.sql.DataSource)      
>               context.lookup("??????");
> "
> Question: how to do it? I suppose I could manage it with 
> local jndi references... but I need a hint.

There are tags for local references in XDoclet. I included them in the
beginnnig in my beans, but I ended up using the utility classes XDoclet
creates. Another option is to use the ServiceLocator pattern. It could
read in a properties file at startup with the JNDI names and cache the
homes. That way if you change how you look up your beans later, it's
encapsulated in one place, along with the error-handling and logging.

In any case, here are the tags in a User entity bean that has a 1:N to
Address:

 * @ejb.ejb-ref
 *      ejb-name="Phone"
 *      ref-name="ejb/Phone"
 *      view-type="local"

The ref-name is "ejb/<ejb-name>" by default as per the docs
(http://xdoclet.sourceforge.net/tags/[EMAIL PROTECTED](0..*)
). To look it up, I believe you do a JNDI lookup using
"java:comp/env/ejb/Phone". Hmm, looking at the weblogic tag docs
(http://xdoclet.sourceforge.net/tags/[EMAIL PROTECTED]
eference-description%20(0..1)) I see it has a mandatory field for JNDI
name (the physical one bound at deployment).

Ah well, let us know how it goes ... maybe update some docs. :)

David Harkness
Sr. Software Engineer
Sony Pictures Digital Networks
(310) 482-4756


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to