Hi Mohit,
Question 1.If this element is not specified,then How can explicit lookups of the named resource will fail ? Can someone provide example or refer to a resource explaining the same
What they mean is that if the <env-entry-value> is not in the ejb-jar.xml, there won't be an entry in the beans environment. So when you lookup the entry explicitly (by context.lookup()) it will fail.
Maybe an example is better:
My ejb.jar.xml
My bean:
Question 2:How can the Deployer to create subcontexts ?Can someone provide example or refer to a resource explaining the same
A little bit earlier in the specs you will find the hint:
The EJB specification recommends, but does not require, that all references to other enterprise beans be organized in the ejb subcontext of the bean's environment (i.e., in the java:comp/env/ejb JNDI context). Note that enterprise bean references declared by means of annotations will not, by default, be in any subcontext.
So the subcontext is just a sort of subdirectory.
If you follow the recommendations you will name all the
ejb references like "ejb/xxx" and with that you have created your subcontext "ejb".
For example:
Regards,
Frits