-
-
2. Re: env-entry configuration
kentcb Oct 1, 2003 6:03 PM (in response to kentcb)OK; any chance you could ellaborate on that? Why can't this be done? Are there plans to implement this soon? How do others work around this problem?
Thanks,
Kent -
3. Re: env-entry configuration
juha Oct 1, 2003 6:23 PM (in response to kentcb)It can't be done because the EJB spec disallows any modifications to the env-entries from the EJB; you can only read them.
If you need modifiable entries in the JNDI you can bind them into the public JNDI context, javax.naming.Context.bind()
-- Juha -
4. Re: env-entry configuration
kentcb Oct 1, 2003 6:34 PM (in response to kentcb)Sorry, there must be a misunderstanding here somewhere. I don't want my EJBs to modify the environment entry. They simply read and use the value of the env-entry. I want the deployer of my application to be able to modify these entries to suit the particular environment they have deployed to.
The EJB Spec [2.0], section 20.2.1.2 states the following:
If the Bean Provider provides a value for an environment entry using the env-entry-value element,
the value can be changed later by the Application Assembler or Deployer.
That implies that there should be some mechanism via which env-entries can be modified after deployment.
Kent -
5. Re: env-entry configuration
juha Oct 1, 2003 8:03 PM (in response to kentcb)No, both application assembler and deployer roles are prior to actual deployment to the app server: application assembler composes an EAR out of J2EE components and deployer sets up the resource mappings to match the current deployment environment. Once the env-entry is bound to the bean's private ENC it's read-only.
-- Juha -
6. Re: env-entry configuration
frito Oct 2, 2003 1:28 AM (in response to kentcb)You probably want to map a global (or vm) namespace to a comp/env namespace for your bean, so the bean always uses the comp/env jndi name and the mapping to the real resource is done in your deployment descriptors of your bean when the bean is deployed.
Use the resource tags with your deployment descriptors.
Greetings,
Frito