-
1. Re: jndi datasource and ejb rules
spiritualmechanic Apr 28, 2004 10:19 AM (in response to xs2iop)I don't think you need to put the comp/env in the <jndi-name> tag. The container should take care of that. Not sure if that's the whole problem.
Steve -
2. Re: jndi datasource and ejb rules
xs2iop Apr 28, 2004 11:48 AM (in response to xs2iop)hello spiritualmechanic and thanks
it's just i thank...and so, like a paranoiak, I test this suite :
in file *-ds.xml : gaiaDS
on lookup : lookup("java:/gaiaDS");
--->OK
in file *-ds.xml :...>jdbc/gaiaDS<...
on lookup : lookup("java:/jdbc/gaiaDS");
--->OK
in file *-ds.xml : ...>env/jdbc/gaiaDS<...
on lookup : lookup("java:/env/jdbc/gaiaDS");
--->OK
in file *-ds.xml : ...>comp/env/jdbc/gaiaDS<...
on lookup : lookup("java:/comp/env/jdbc/gaiaDS");
--->NOK with ex message :
EJBException : jdbc not bound !!!!
strange no?
i can use the first solution with simple namespace, but i would like understand how to jboss make jndi context.
how do you proceed yourself for naming rules?
Regards
Sébastien/xs2iop@yahoo.fr -
3. Re: jndi datasource and ejb rules
jonlee Apr 29, 2004 6:43 AM (in response to xs2iop)A java:comp/env/... is a local reference or alias for a JNDI name.
So in my ejb-jar.xml I might have:<resource-ref > <res-ref-name>jdbc/amity/AmityPool</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Application</res-auth> </resource-ref>
In my jboss.xml, I would have this:<resource-ref> <res-ref-name>jdbc/amity/AmityPool</res-ref-name> <jndi-name>java:/AmityPool</jndi-name> </resource-ref>
So my lookup in the ejb would be:lookup("java:comp/env/jdbc/amity/AmityPool")
You can read more on this and the use of XDoclet to help generate these at:
http://www.amitysolutions.com.au/documents/JBossJNDI-technote.pdf