EJB 2.0 spec does not allow for this, AFAIK. EJBs are not allowed to see each other env crap.
The other problem I had was how to share env info between not only EJBs, but Web App components as well.
One solution is to have a 'global' properties file somewhere URL-loadable, and point to it from your "env-entry"s like:
I haven't done it, but it's an idea.
I got sick of maintaining this kind of stuff in ejb-jar.xml and web.xml, so here's what I did.
I wrote an MBean to act as a deployer of properties, specifically, as a deployer of *properties.xml (of my own schema) files in the deploy directory. The deployer MBean then launches a 'deployment' mbean for each config file. The properties are then bound by the deployment mbean into JNDI to a known path (including app/module name).
That way I can get to them from anywhere, since each app knows its "name", therefore the path to its env entries. These are basic key value pairs, where values are presumed type String.
It's similar to the properties-service, but instead of putting them into System.properties, they are in JNDI.
This probably has drawbacks (I have not considered the impact of clustered JNDI for example) and there will be folks who think there something bad about this, but it works very well for us. Especially great is the ability to hot-deploy these properties.
Thanks for the idea. Looks like I won't get around writting an MBean for this...