You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by David Jencks <da...@yahoo.com> on 2009/05/20 09:16:37 UTC

Re: Possible for G to directly consume a Tomcat server config w/o changes?

On May 19, 2009, at 8:17 PM, Lin Sun wrote:

> I am not a tomcat expert either... :-)  I think we could also try the
> following approach:
> 1. figure out how to read tomcat server.xml like you described.
> Tomcat is using
> 2. at the G server startup, transform data in tomcat server.xml into G
> config.xml, if there is change to server.xml since last time server
> started.  I think coming up for the mapping could be hard as
> configuring some features like valve or cluster requires
> documentation, time and experience.   Also, there could be some
> functions/configurations in server.xml that we don't support in G yet.

I'm not sure about this idea.  It seems really contrary to how most of  
geronimo works.... where we take some kind of plan and more or less  
freeze the configuration while "pre-deploying" it into a pretty much  
immutable plugin.  I'm not convinced that accepting a new kind of plan  
for a few gbeans requires adding this "continual redeploy"  
functionality to geronimo.

>
> 3. During G startup, G can just build the embedded tomcat server by
> reading data from config.xml, like what it is doing today.

config.xml doesn't have to contain any info on the tomcat server  
except that it ought to be started, i.e. listing the plugin.  The  
gbean configurations are all serialized in the plugin.  I'd generally  
prefer it if we dropped the ability to add gbeans to a plugin via  
config.xml.

>
>
> AFAIK, server.xml doesn't contain any app info.   I agree that this is
> a very big change and requires a lot of testing to make sure things
> are not regressed.
Adding this new namespace driven builder is entirely new functionality  
so there is not really any chance of regressions unless we decide to  
deploy the "standard" tomcat server this way, which is certainly not  
necessary to adding the feature.  So, to me the only problems are  
actually writing the deployer and making sure it at least sort of works.

thanks
david jencks

>
>
> Lin
>
> On Tue, May 19, 2009 at 6:09 PM, David Jencks  
> <da...@yahoo.com> wrote:
>> I'm not enough of a tomcat expert to know exactly what information a
>> server.xml contains so I'm not quite sure how much the following  
>> makes
>> sense.
>>
>> I think I would approach this by building a namespace aware builder  
>> that can
>> interpret documents following the server.xml schema  and construct  
>> the
>> entire tomcat server from it.  In other words, instead of starting  
>> with our
>> current tomcat6 plugin, the builder would construct a replacement  
>> for it
>> from the server.xml.  If server.xml contains info on apps that are  
>> deployed
>> in the tomcat instance, this could perhaps hook into or extend the  
>> current
>> TomcatModuleBuilder to also set up plugins for each web app involved.
>>
>> The first part here might not be too hard.  IMO if we treat the  
>> server.xml
>> as a geronimo plan that would be acceptable.  I'd recommend trying  
>> jaxb
>> rather than using xmlbeans.  I don't know how practical this would  
>> turn out
>> to be but it's worth starting with.
>>
>> I personally think this is too large an addition to plan to get  
>> into 2.2.
>> However if a motivated person shows up with something working  
>> before we
>> solve the other problems I think we could consider it.  2.2 is  
>> already so
>> much later than we had planned I don't want to hold it up for any new
>> features after the other problems have been solved.
>>
>> thanks
>> david jencks
>>
>>>
>>>> Lin
>>>>
>>>> On Mon, May 18, 2009 at 3:49 PM, Bill Stoddard <wgstoddard@gmail.com 
>>>> >
>>>> wrote:
>>>>
>>>>> I know G can't consume tomcat configs today, but is this a  
>>>>> feature that
>>>>> could be developed for G 2.2?
>>>>>
>>>>> Say I have an application successfully deployed and running under
>>>>> Tomcat..
>>>>> wouldn't it be nice if I were able to drop the tomcat server  
>>>>> config into
>>>>> a
>>>>> Geronimo-Tomcat assembly, start the server, deploy the app and  
>>>>> be up and
>>>>> running in seconds.  I'm talking about a seamless, zero effort/ 
>>>>> zero
>>>>> touch
>>>>> migration from Tomcat to a Geronimo-Tomcat assembly.  Is it  
>>>>> possible?
>>>>> If
>>>>> not, what simplifying assumptions could be made to 'mostly'  
>>>>> achieve a
>>>>> zero-touch migration?
>>>>> What are the primary challenges with consuming a tomcat config  
>>>>> unchanged
>>>>> with a G-Tomcat assembly?  Same Q's apply for Jetty... what's  
>>>>> 'doable'
>>>>> with-in reason?
>>>>>
>>>>> Thanks,
>>>>> Bill
>>>>>
>>>>>
>>>>
>>>>
>>>
>>

Re: Possible for G to directly consume a Tomcat server config w/o changes?

Posted by Jack Cai <gr...@gmail.com>.
Agree that we won't contain this in G 2.2, but it might be a candidate
feature for futher release like JEE6 Web Profile.

Importing Tomcat server configs is relatively easier than importing Tomcat
applications. If we consider an application which uses Struts, Hibernate,
Spring, AXIS2 etc. (which is quite common), things becomes much complex.
Still, doable, but not a trivial work.

-Jack

2009/5/20 Ivan <xh...@gmail.com>

> I guess that what David means is that writing a deployer for server.xml,
> then in the builder class, construct those tomcat server gbeans, and add
> those gbeans to the tomcat plugin section in the config.xml. So that we
> could imitate a totally same tomcat environment for those tomcat-ready
> applications.
> Right ?
>     Ivan
>
> 2009/5/20 Lin Sun <li...@gmail.com>
>
> One example that we did this is with the config-substitution property
>> file where we allow users to specify configuration and the server
>> reads the config-substitution property file during the startup of the
>> server.   If we more or less freeze the configuration, wouldn't this
>> (reading data from server.xml and build the tomcat plugin) have to be
>> done at the build time when we build the geronimo plugin for tomcat
>> using maven2?    I think the user would want to do this at runtime
>> where the geronimo server is already prebuilt.
>>
>> On Wed, May 20, 2009 at 3:16 AM, David Jencks <da...@yahoo.com>
>> wrote:
>>
>> > I'm not sure about this idea.  It seems really contrary to how most of
>> > geronimo works.... where we take some kind of plan and more or less
>> freeze
>> > the configuration while "pre-deploying" it into a pretty much immutable
>> > plugin.  I'm not convinced that accepting a new kind of plan for a few
>> > gbeans requires adding this "continual redeploy" functionality to
>> geronimo.
>> >
>> >>
>> >> 3. During G startup, G can just build the embedded tomcat server by
>> >> reading data from config.xml, like what it is doing today.
>> >
>> > config.xml doesn't have to contain any info on the tomcat server except
>> that
>> > it ought to be started, i.e. listing the plugin.  The gbean
>> configurations
>> > are all serialized in the plugin.  I'd generally prefer it if we dropped
>> the
>> > ability to add gbeans to a plugin via config.xml.
>>
>> Again, this may be something that I don't understand well.  If we
>> don't configure it in config.xml, how do we allow users to drop in
>> their tomcat server.xml without rebuilding the tomcat plugin?
>>
>> >>
>> >> AFAIK, server.xml doesn't contain any app info.   I agree that this is
>> >> a very big change and requires a lot of testing to make sure things
>> >> are not regressed.
>> >
>> > Adding this new namespace driven builder is entirely new functionality
>> so
>> > there is not really any chance of regressions unless we decide to deploy
>> the
>> > "standard" tomcat server this way, which is certainly not necessary to
>> > adding the feature.  So, to me the only problems are actually writing
>> the
>> > deployer and making sure it at least sort of works.
>>
>> To me, anything that has been changed needs to be tested somehow :)
>> Regarding writing the deployer, I assume you meant the ability for G
>> to deploy tomcat ready web archives.   I think this can involve a
>> large number of work, basically, we have to be able to generate
>> geronimo-web.xml for the user's web archives, and deploy the web
>> archive using the generated geronimo-web.xml file.
>>
>> Lin
>>
>
>
>
> --
> Ivan
>

Re: Possible for G to directly consume a Tomcat server config w/o changes?

Posted by David Jencks <da...@yahoo.com>.
On May 20, 2009, at 7:44 AM, Ivan wrote:

> I guess that what David means is that writing a deployer for  
> server.xml, then in the builder class, construct those tomcat server  
> gbeans, and add those gbeans to the tomcat plugin section in the  
> config.xml. So that we could imitate a totally same tomcat  
> environment for those tomcat-ready applications.

Not exactly.

Right now we supply one preconfigured tomcat server in the tomcat  
plugin.  You can deploy more if you want, and your app can choose  
which one to use with the (IIRC) web-container element in its plan.   
You can also use artifact-aliases to get one you deploy to replace the  
standard one.

I'm suggesting writing a builder, maybe tomcat-server-builder, for  
server.xml files that produces plugins that are similar to the tomcat  
plugin.  What happens to these plugins is a separate question.  I'd  
assume most people would want to replace the supplied tomcat plugin  
with the one built out of their server.xml file but this is not an  
essential part of what I'm suggesting.

thanks
david jencks

>
> Right ?
>     Ivan
>
> 2009/5/20 Lin Sun <li...@gmail.com>
> One example that we did this is with the config-substitution property
> file where we allow users to specify configuration and the server
> reads the config-substitution property file during the startup of the
> server.   If we more or less freeze the configuration, wouldn't this
> (reading data from server.xml and build the tomcat plugin) have to be
> done at the build time when we build the geronimo plugin for tomcat
> using maven2?    I think the user would want to do this at runtime
> where the geronimo server is already prebuilt.
>
> On Wed, May 20, 2009 at 3:16 AM, David Jencks  
> <da...@yahoo.com> wrote:
>
> > I'm not sure about this idea.  It seems really contrary to how  
> most of
> > geronimo works.... where we take some kind of plan and more or  
> less freeze
> > the configuration while "pre-deploying" it into a pretty much  
> immutable
> > plugin.  I'm not convinced that accepting a new kind of plan for a  
> few
> > gbeans requires adding this "continual redeploy" functionality to  
> geronimo.
> >
> >>
> >> 3. During G startup, G can just build the embedded tomcat server by
> >> reading data from config.xml, like what it is doing today.
> >
> > config.xml doesn't have to contain any info on the tomcat server  
> except that
> > it ought to be started, i.e. listing the plugin.  The gbean  
> configurations
> > are all serialized in the plugin.  I'd generally prefer it if we  
> dropped the
> > ability to add gbeans to a plugin via config.xml.
>
> Again, this may be something that I don't understand well.  If we
> don't configure it in config.xml, how do we allow users to drop in
> their tomcat server.xml without rebuilding the tomcat plugin?
>
> >>
> >> AFAIK, server.xml doesn't contain any app info.   I agree that  
> this is
> >> a very big change and requires a lot of testing to make sure things
> >> are not regressed.
> >
> > Adding this new namespace driven builder is entirely new  
> functionality so
> > there is not really any chance of regressions unless we decide to  
> deploy the
> > "standard" tomcat server this way, which is certainly not  
> necessary to
> > adding the feature.  So, to me the only problems are actually  
> writing the
> > deployer and making sure it at least sort of works.
>
> To me, anything that has been changed needs to be tested somehow :)
> Regarding writing the deployer, I assume you meant the ability for G
> to deploy tomcat ready web archives.   I think this can involve a
> large number of work, basically, we have to be able to generate
> geronimo-web.xml for the user's web archives, and deploy the web
> archive using the generated geronimo-web.xml file.
>
> Lin
>
>
>
> -- 
> Ivan


Re: Possible for G to directly consume a Tomcat server config w/o changes?

Posted by Ivan <xh...@gmail.com>.
I guess that what David means is that writing a deployer for server.xml,
then in the builder class, construct those tomcat server gbeans, and add
those gbeans to the tomcat plugin section in the config.xml. So that we
could imitate a totally same tomcat environment for those tomcat-ready
applications.
Right ?
    Ivan

2009/5/20 Lin Sun <li...@gmail.com>

> One example that we did this is with the config-substitution property
> file where we allow users to specify configuration and the server
> reads the config-substitution property file during the startup of the
> server.   If we more or less freeze the configuration, wouldn't this
> (reading data from server.xml and build the tomcat plugin) have to be
> done at the build time when we build the geronimo plugin for tomcat
> using maven2?    I think the user would want to do this at runtime
> where the geronimo server is already prebuilt.
>
> On Wed, May 20, 2009 at 3:16 AM, David Jencks <da...@yahoo.com>
> wrote:
>
> > I'm not sure about this idea.  It seems really contrary to how most of
> > geronimo works.... where we take some kind of plan and more or less
> freeze
> > the configuration while "pre-deploying" it into a pretty much immutable
> > plugin.  I'm not convinced that accepting a new kind of plan for a few
> > gbeans requires adding this "continual redeploy" functionality to
> geronimo.
> >
> >>
> >> 3. During G startup, G can just build the embedded tomcat server by
> >> reading data from config.xml, like what it is doing today.
> >
> > config.xml doesn't have to contain any info on the tomcat server except
> that
> > it ought to be started, i.e. listing the plugin.  The gbean
> configurations
> > are all serialized in the plugin.  I'd generally prefer it if we dropped
> the
> > ability to add gbeans to a plugin via config.xml.
>
> Again, this may be something that I don't understand well.  If we
> don't configure it in config.xml, how do we allow users to drop in
> their tomcat server.xml without rebuilding the tomcat plugin?
>
> >>
> >> AFAIK, server.xml doesn't contain any app info.   I agree that this is
> >> a very big change and requires a lot of testing to make sure things
> >> are not regressed.
> >
> > Adding this new namespace driven builder is entirely new functionality so
> > there is not really any chance of regressions unless we decide to deploy
> the
> > "standard" tomcat server this way, which is certainly not necessary to
> > adding the feature.  So, to me the only problems are actually writing the
> > deployer and making sure it at least sort of works.
>
> To me, anything that has been changed needs to be tested somehow :)
> Regarding writing the deployer, I assume you meant the ability for G
> to deploy tomcat ready web archives.   I think this can involve a
> large number of work, basically, we have to be able to generate
> geronimo-web.xml for the user's web archives, and deploy the web
> archive using the generated geronimo-web.xml file.
>
> Lin
>



-- 
Ivan

Re: Possible for G to directly consume a Tomcat server config w/o changes?

Posted by Lin Sun <li...@gmail.com>.
One example that we did this is with the config-substitution property
file where we allow users to specify configuration and the server
reads the config-substitution property file during the startup of the
server.   If we more or less freeze the configuration, wouldn't this
(reading data from server.xml and build the tomcat plugin) have to be
done at the build time when we build the geronimo plugin for tomcat
using maven2?    I think the user would want to do this at runtime
where the geronimo server is already prebuilt.

On Wed, May 20, 2009 at 3:16 AM, David Jencks <da...@yahoo.com> wrote:

> I'm not sure about this idea.  It seems really contrary to how most of
> geronimo works.... where we take some kind of plan and more or less freeze
> the configuration while "pre-deploying" it into a pretty much immutable
> plugin.  I'm not convinced that accepting a new kind of plan for a few
> gbeans requires adding this "continual redeploy" functionality to geronimo.
>
>>
>> 3. During G startup, G can just build the embedded tomcat server by
>> reading data from config.xml, like what it is doing today.
>
> config.xml doesn't have to contain any info on the tomcat server except that
> it ought to be started, i.e. listing the plugin.  The gbean configurations
> are all serialized in the plugin.  I'd generally prefer it if we dropped the
> ability to add gbeans to a plugin via config.xml.

Again, this may be something that I don't understand well.  If we
don't configure it in config.xml, how do we allow users to drop in
their tomcat server.xml without rebuilding the tomcat plugin?

>>
>> AFAIK, server.xml doesn't contain any app info.   I agree that this is
>> a very big change and requires a lot of testing to make sure things
>> are not regressed.
>
> Adding this new namespace driven builder is entirely new functionality so
> there is not really any chance of regressions unless we decide to deploy the
> "standard" tomcat server this way, which is certainly not necessary to
> adding the feature.  So, to me the only problems are actually writing the
> deployer and making sure it at least sort of works.

To me, anything that has been changed needs to be tested somehow :)
Regarding writing the deployer, I assume you meant the ability for G
to deploy tomcat ready web archives.   I think this can involve a
large number of work, basically, we have to be able to generate
geronimo-web.xml for the user's web archives, and deploy the web
archive using the generated geronimo-web.xml file.

Lin