Answer 2 is incorrect because enterprise bean instances can only read the values of the environment entries at runtime and are not able to modify them. Answers 3 and 4 are incorrect because the deployment descriptor is used to define only the environment entries, as opposed to the values that the enterprise bean expects to be provided at runtime.
4. Enterprise bean instances obtain the values of the environment entries from the enterprise bean's deployment descriptor.
I think 4 is incorrect because Enterprise bean instances do not obtain the values of the environment entries from the enterprise bean's deployment descriptor but rather from the its special environment (i.e. its jndi subcontext "java:comp/env"). Environment entries are defined in the deployment descriptor, once ejb-jar is deployed into the app server environment entries get associated with the jndi names, and these are the names that ejb instances use to look environment entry value up.
3. The deployer sets and modifies the values of the environment entries by editing the enterprise bean's deployment descriptor.
I think 3 is a correct answer as deployer must ensure that <env-entry-value> contains a legal value. Please see paragraph 20.2.3 on page 415
All right, my answers to this question would be 1, 3 and 5.
Alex (SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJD 1.4)
Joined: Oct 22, 2000
Originally posted by Sujatha Kumar: to conclude 1,4 and 5 are correct answers
20.2 Enterprise Bean�s Environment as a JNDI Naming Context 3. The Deployer uses the tools provided by the container to create the environment entries that are declared in the enterprise bean�s deployment descriptor. The Deployer can set and modify the values of the environment entries.