geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Wilkes <>
Subject Re: Ability to set per-deployment gbeans?
Date Wed, 17 May 2006 15:11:16 GMT
On Tue, May 16, 2006 at 08:28:19PM -0400, Aaron Mulder wrote:
> Are we talking about Geronimo 1.0 or 1.1?  It will be quite easy to do
> this in 1.1, but might be a bit more manual in 1.0.

I'm using IBM's "distribution" of Geronimo, version

> Also, do I understand correctly that you have a single WAR with a
> separate geronimo-web.xml for each customer?

Yes, I have one war file and then deploy for each customer with a
separate geronimo-web.xml file, containing information that indentifies
that customer.

> Thanks,
>    Aaron
> On 5/16/06, Chris Wilkes <> wrote:
> >I have a webapp that I'm going to reuse for several customers and would
> >like to have the configuration information (customer name, database
> >schema info, etc) live outside of the webapp.
> >
> >Normally I would would put this sort of information into the web.xml's
> >init-param so that I could get it via the ServletContext.  However I
> >would like to deploy the exact same war for different customers and
> >don't want to open up the war, add that setting, and the re-create the
> >war file.
> >
> >I've tried to find a way to access the configId that I've individually
> >set for each customer but can't find a way to get at the one that
> >relates to the webapp that's being deployed -- I query the kernel for a
> >list of gbeans and I can see all of the other webapps on the geronimo
> >server.  I have no idea which one is "mine" as they all look the same.
> >
> >Looking through the archives I found this post:
> >
> >but I'm not sure how to implement it.
> >
> >It would be handy if I could set some init-params from within my
> >geronimo-web.xml file as I could grab those out of the ServletContext as
> >I would give them a defined name ("CUSTOMERID") and in my application I
> >would do a
> >  webApplicationContext.getServletContext().getInitParameter("CUSTOMERID")
> >from within one of my spring classes.
> >
> >Has anyone else encountered this?
> >
> >What I'm heading toward doing is having Apache answer requests for
> > and then passing those along via ajp13 to the
> >geronimo server(s) at http://geronimoNNN/customerName .  That webapp
> >will have an object created by Spring that has a method that returns all
> >the Properties associated with that particular customerName.  Since this
> >is needed at startup I can't rely on the HttpServletRequest to get the
> >context-root as I need to configure everything before the first request
> >comes in.
> >
> >I'm thinking a "locally scoped" gbean defined in the geronimo-web.xml
> >could do this, but my reading of the docs says that gbeans defined in
> >there can be used by all webapps -- and so I'll have to give each one a
> >unique name meaning that I can't hardcode in my spring config which one
> >to look for.
> >
> >Chris
> >

View raw message