Every type of
EJB gets an environment naming context, which is the java:comp/env JNDI context. The scope of the environment is for all bean instances from the same home. If a bean were deployed twice, it would have two homes and therefore two environments.
So, a bean starts navigating from the java:comp/env environment to do lookups. The EJB spec recommends, but does not mandate, that all resource manager connection factory references be organised in the subcontexts of the bean�s environment, using a different subcontext for each resource manager type as follows.
java:comp/env/ejb - EJB homes
java:comp/env/jdbc - DataSource
java:comp/env/mail - JavaMail
java:comp/env/jms - JMS connection factories
java:comp/env/url - URL connection factories