4 Replies Latest reply on Sep 19, 2005 9:45 AM by Andreas Wieczorek

    deploy time configuration of EJB's

    Joshua Groom Newbie


      We are running into the problem of EJB's requiring environmental configuration such as ports remote hosts etc. The obvious solution seems to be to use the env-entry in ejb-jar.xml or to use a properties file inside the jar file but this means that to reconfigure the bean you must rebuild or at least manipulate the jar file. I don't want to go down this road really because I need to deploy the same bean in a lot of places with different config and it will become tiresome...

      I would have thought that there would be a way for the container to provide configuration to the bean, specifically to over-ride the ejb-jar.xml or resolve names provided in there. It can be done for Datasources but this doesn't seem to be the case for name, value pair type resources like env-entry in ejb-jar.xml.

      One solution is to use system properties provided on the command line eg -Dx.y.z=blah referenced in the Bean code but this doesn't seem very nice.

      Any advice would be appreciated, thanks.