According to the EJB Study guide by MZ, when the @Resource annotation is used, it is relative to the java:comp/env naming context.
For example : @Resource(name="db") DataSource;
The container will search in the JNDI registry for the name : java:comp/env/db
When I tried to create such a resource with the name : java:comp/env/db, I received an error that says the JNDI name I provided is not a valid JNDI name.
This happend on Glassfish application server that ships with Netbeans 6.0
Why does this happen ???
SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/ Life is the biggest school