geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Customizing deployment descriptor values at deployment time?
Date Tue, 04 Nov 2008 16:53:43 GMT

On Nov 4, 2008, at 9:30 AM, cgreco16 wrote:

> I'm writing a web application and I need to allow the deployer/ 
> administrator
> to customize values in the deployment descriptor.  I'm trying to use
> <env-entry> elements in the deployment descriptor to do this.  The  
> JavaEE 5
> spec says on page 71 "If the Application Component 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."

I've always found this statement incomprehensible.   AFAICT it means  
that you can fire up emacs or vi and edit web.xml and sun won't send  
the ee police after you.

>  However, I don't
> see how to change these values when deploying an app with Geronimo.
> Geronimo appears to have modified my web.xml file, removing the env- 
> entry
> elements, and used them to create a serialized config object that I  
> can't
> change.
> The geronimo-web.xml schema does not appear to have anything for this
> purpose either.

Unfortunately we don't have a way to override the env-entry values in  
the geronimo plan.  I think someone said they were working on this  

I think if you use the car-maven-plugin to "pre-deploy" your app as a  
geronimo plugin you could use maven to do property substitution in  
your web.xml.

Another strategy that might work for you -- although it does seem a  
bit ugly to me -- is to use system properties for the customizable  
values.  We have a SystemPropertiesGBean that can set properties for  
you.  You can override the properties setting in config.xml and  
include ${varName} substitutions in the override and supply the values  
for the variables in var/config/  This  
is easiest to set up if you deploy the system props gbean in a  
geronimo plugin, either standalone or in the geronimo plan for your app.

in the plan....

     <gbean name="MySystemProperties"
          <attribute name="systemProperties">

in config.xml in the module for your plugin or app...

     <gbean name="MySystemProperties">
          <attribute name="systemProperties">${prop1}${prop2}

in var/config/


You can arrange for this to get installed with your app using a  
geronimo-plugin.xml file, which is most easily generated by the car- 

david jencks

> Any help is appreciated.
> cgreco16
> -- 
> View this message in context:
> Sent from the Apache Geronimo - Users mailing list archive at  

View raw message