You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Steve Downey <st...@netfolio.com> on 2002/08/14 07:24:33 UTC
[5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
This patch starts up a copy of tomcat with the watchdog war files, runs
watchdog against it, and shuts down tomcat afterwards. It uses the Launcher
to run tomcat in the background, and puts the webapps, work, logs and conf
directories in a tmp dir so as not to muck up the build.
The only part I really don't like is that there isn't a good way to know that
tomcat is up and running, so for now there's a sleep between launching tomcat
and starting the watchdog tests.
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by Steve Downey <st...@netfolio.com>.
Jean-francois Arcand wrote:
>
>
> Steve Downey wrote:
>
>> Thanks for pointing the tomcat5 task out. I'm trying to reimplement
>> with that, and have run into a couple of snags.
>>
>> First is that o.a.c.startup.CatalinaService doesn't distinguish
>> between catalina.home and catalina.base. setHome() actually sets both
>> of them. Adding a setBase() is trivial, but it affects the semantics
>> of initialization. Any current client expects both to be set by a
>> call to setHome(), and just moving the setProperty to setBase()
>> breaks that. Of course if the setProperty("catalina.base",s) is left
>> in setHome(), then initialization is order dependent. For now, and I
>> just added a setBase() and ignored the problem.
>>
>> The next problem was that the task runs in VM. Ant's xercesImpl
>> chokes on parsing the schemas. This is the known dependency on Xerces
>> 2.0.1. Replacing the xercesImpl.jar in Ant fixed that, but that seems
>> an ugly requirement.
>
>
> The problem should occurs only with Xerces 2.0.2. Is 2.0.2 bundle with
> ANT 1.5? If you try with the current Xerces nightly build, it should
> work. This is a big paint because Xerces 2.0.2 seems to be used
> everywhere....The only solution will be to set the schema validation
> off, or detect the Xerces version and throw an exception before
> starting parsing a file.
>
Yes, it's Xerces 2.0.2. At least that's what the README claims. From
what I understand it's not sufficient to turn schema validation off,
although I haven't verified that. Is there a good way of detecting
which version of Xerces is present?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by Remy Maucherat <re...@apache.org>.
costinm@covalent.net wrote:
> On Wed, 14 Aug 2002, Jean-francois Arcand wrote:
>
>
>>The problem should occurs only with Xerces 2.0.2. Is 2.0.2 bundle with
>>ANT 1.5? If you try with the current Xerces nightly build, it should
>>work. This is a big paint because Xerces 2.0.2 seems to be used
>>everywhere....The only solution will be to set the schema validation
>>off, or detect the Xerces version and throw an exception before starting
>>parsing a file.
>
>
> Turn schema validation off, and leave it off. Tomcat5 working with a
> single parser is not good.
>
> And while you're doing that, turn also DTD validation off and leave it
> off unless a user wants to enable it explicitely.
>
> Validation should be done by a deploy tool or build tool ( offline ).
> Or by tomcat if a mechanism to avoid duplicated validation is provided.
+1 !
Remy
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by co...@covalent.net.
On Wed, 14 Aug 2002, Jean-francois Arcand wrote:
> The problem should occurs only with Xerces 2.0.2. Is 2.0.2 bundle with
> ANT 1.5? If you try with the current Xerces nightly build, it should
> work. This is a big paint because Xerces 2.0.2 seems to be used
> everywhere....The only solution will be to set the schema validation
> off, or detect the Xerces version and throw an exception before starting
> parsing a file.
Turn schema validation off, and leave it off. Tomcat5 working with a
single parser is not good.
And while you're doing that, turn also DTD validation off and leave it
off unless a user wants to enable it explicitely.
Validation should be done by a deploy tool or build tool ( offline ).
Or by tomcat if a mechanism to avoid duplicated validation is provided.
Costin
>
> -- Jeanfrancois
>
> >
> >
> > In any case, after doing that, Catalina service starts up, but doesn't
> > seem to be able to find the servlet apis to compile JSP pages. As an
> > added irritation, stdout isn't redirected to catalina.out, and it is
> > quite noisy.
> >
> > So, my current patch may not be the best possible, but it does have
> > the advantage of working.
> >
> > I think it will make more sense to use the launcher as the basis for a
> > task to run tomcat. Running it in process leads to a lot of state
> > leaking over. For testing I think it's safer to run it as much as
> > possible in its own environment.
> >
> > This is what I was using for the tomcat5 task:
> > <property name="tools.jar"
> > location="${java.home}/../lib/tools.jar" />
> > <path id="tomcatcp" >
> > <pathelement location="${tomcat.build}/server/classes"/>
> > <pathelement location="${tools.jar}" />
> > <fileset dir="${tomcat.build}/server/lib">
> > <include name="**/*.jar"/>
> > </fileset>
> > <fileset dir="${tomcat.build}/common/lib">
> > <include name="**/*.jar"/>
> > </fileset>
> > <fileset dir="${tomcat.build}/common/endorsed">
> > <include name="**/*.jar"/>
> > </fileset>
> > <fileset dir="${tomcat.build}/shared/lib">
> > <include name="**/*.jar"/>
> > </fileset>
> > </path>
> > <taskdef name="tomcat5"
> > classname="org.apache.catalina.startup.CatalinaService"
> > classpathref="tomcatcp" />
> > <tomcat5 do="start"
> > home="${tomcat.build}"
> > base="${basedir}/tmp/tomcat"
> > wait="false"/>
> >
> >
> > costinm@covalent.net wrote:
> >
> >> On Wed, 14 Aug 2002, Steve Downey wrote:
> >>
> >>> This patch starts up a copy of tomcat with the watchdog war files,
> >>> runs watchdog against it, and shuts down tomcat afterwards. It uses
> >>> the Launcher to run tomcat in the background, and puts the webapps,
> >>> work, logs and conf directories in a tmp dir so as not to muck up
> >>> the build.
> >>>
> >>> The only part I really don't like is that there isn't a good way to
> >>> know that tomcat is up and running, so for now there's a sleep
> >>> between launching tomcat and starting the watchdog tests.
> >>>
> >>
> >> For tomcat5 ? Well, it is - if you use the task ( take a look at
> >> build2.xml ). The task will start tomcat inprocess, and will return
> >> after all the startup is done ( and continue with the next task ).
> >>
> >> ( unless you have wait="true" )
> >>
> >> Costin
> >>
> >>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> >> <ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
> >> <ma...@jakarta.apache.org>
> >>
> >>
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by Jean-francois Arcand <je...@sun.com>.
Steve Downey wrote:
> Thanks for pointing the tomcat5 task out. I'm trying to reimplement
> with that, and have run into a couple of snags.
>
> First is that o.a.c.startup.CatalinaService doesn't distinguish
> between catalina.home and catalina.base. setHome() actually sets both
> of them. Adding a setBase() is trivial, but it affects the semantics
> of initialization. Any current client expects both to be set by a call
> to setHome(), and just moving the setProperty to setBase() breaks
> that. Of course if the setProperty("catalina.base",s) is left in
> setHome(), then initialization is order dependent. For now, and I just
> added a setBase() and ignored the problem.
>
> The next problem was that the task runs in VM. Ant's xercesImpl chokes
> on parsing the schemas. This is the known dependency on Xerces 2.0.1.
> Replacing the xercesImpl.jar in Ant fixed that, but that seems an ugly
> requirement.
The problem should occurs only with Xerces 2.0.2. Is 2.0.2 bundle with
ANT 1.5? If you try with the current Xerces nightly build, it should
work. This is a big paint because Xerces 2.0.2 seems to be used
everywhere....The only solution will be to set the schema validation
off, or detect the Xerces version and throw an exception before starting
parsing a file.
-- Jeanfrancois
>
>
> In any case, after doing that, Catalina service starts up, but doesn't
> seem to be able to find the servlet apis to compile JSP pages. As an
> added irritation, stdout isn't redirected to catalina.out, and it is
> quite noisy.
>
> So, my current patch may not be the best possible, but it does have
> the advantage of working.
>
> I think it will make more sense to use the launcher as the basis for a
> task to run tomcat. Running it in process leads to a lot of state
> leaking over. For testing I think it's safer to run it as much as
> possible in its own environment.
>
> This is what I was using for the tomcat5 task:
> <property name="tools.jar"
> location="${java.home}/../lib/tools.jar" />
> <path id="tomcatcp" >
> <pathelement location="${tomcat.build}/server/classes"/>
> <pathelement location="${tools.jar}" />
> <fileset dir="${tomcat.build}/server/lib">
> <include name="**/*.jar"/>
> </fileset>
> <fileset dir="${tomcat.build}/common/lib">
> <include name="**/*.jar"/>
> </fileset>
> <fileset dir="${tomcat.build}/common/endorsed">
> <include name="**/*.jar"/>
> </fileset>
> <fileset dir="${tomcat.build}/shared/lib">
> <include name="**/*.jar"/>
> </fileset>
> </path>
> <taskdef name="tomcat5"
> classname="org.apache.catalina.startup.CatalinaService"
> classpathref="tomcatcp" />
> <tomcat5 do="start"
> home="${tomcat.build}"
> base="${basedir}/tmp/tomcat"
> wait="false"/>
>
>
> costinm@covalent.net wrote:
>
>> On Wed, 14 Aug 2002, Steve Downey wrote:
>>
>>> This patch starts up a copy of tomcat with the watchdog war files,
>>> runs watchdog against it, and shuts down tomcat afterwards. It uses
>>> the Launcher to run tomcat in the background, and puts the webapps,
>>> work, logs and conf directories in a tmp dir so as not to muck up
>>> the build.
>>>
>>> The only part I really don't like is that there isn't a good way to
>>> know that tomcat is up and running, so for now there's a sleep
>>> between launching tomcat and starting the watchdog tests.
>>>
>>
>> For tomcat5 ? Well, it is - if you use the task ( take a look at
>> build2.xml ). The task will start tomcat inprocess, and will return
>> after all the startup is done ( and continue with the next task ).
>>
>> ( unless you have wait="true" )
>>
>> Costin
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by Patrick Luby <pa...@sun.com>.
Costin,
I took a look at InspectionUtils.guessInstall() and it looks OK.
However, it has one limitation: it looks at the classpath to guess the
install directory. This works in most cases, but does not work when the
InspectionUtils class is loaded in a classloader. Since both the
commons-launcher and some J2EE servers load Tomcat's Bootstrap class via
a classloader, InspectionUtils.guessInstall() may not work correctly.
The way I worked around this in commons-launcher was to invoke the
getResource() resource on the class e.g. Bootstrap.class.getResource("/"
+ Bootstrap.class.getName() + ".class") to get the classpath element
that this main class was loaded from. This works even if another
application is loading your application using a classloader.
At this point, I could port this "getResource()" logic into
InspectionUtils or I can put this code directly in Bootstrap.java.
What is your preference?
Patrick
costinm@covalent.net wrote:
>
> On Thu, 15 Aug 2002, Patrick Luby wrote:
>
> > Costin,
> >
> > costinm@covalent.net wrote:
> > > Patrick ( if you read this ) - what's the status with the 'guess home' ?
> > > I can use IntrospectionUtils - it has the whole thing in it ( home/base
> > > setting, find in classpath ). We already need IU for jk - it just needs
> > > to be included in bootstrap.jar to do that.
> > >
> >
> > I haven't ported this yet but I can do it very quickly. The question is
> > where should we put it? Originally, I was going to put it in the
> > Bootstrap.getCatalinaHome() method. However, since we are moving towards
> > using CatalinaService, do you think I should put it there?
>
> Probably Bootrstrap is the best place - since it needs to construct the
> classpath to load CatalinaService ( so it needs it ).
>
> If you just include IntrospectionUtil from j-t-c you get it all -
> ( it is used in jk already ). All you need ( besides build.xml changes )
> is:
>
> home= IntrospectionUtils.guessInstall("catalina.home", "catalina.base",
> "bootstrap.jar",
> "org.apache.catalina.startup.CatalinaService");
>
> That will set catalina.home/catalina.base:
> - if only one is set the other will take that value.
> - if none is set, it'll look in CLASSPATH for bootstrap.jar and go one
> level up, or for org/apache... if classes/ is used - and set catalina.home
> fromt that.
>
> You don't need to port it - it is useable directly. ( well, you can
> cut&paste the method if you want, it's independent of the rest )
>
> Costin
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
_____________________________________________________________________
Patrick Luby Email: patrick.luby@sun.com
Sun Microsystems Phone: 408-276-7471
901 San Antonio Road, USCA14-303
Palo Alto, CA 94303-4900
_____________________________________________________________________
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by co...@covalent.net.
On Thu, 15 Aug 2002, Patrick Luby wrote:
> Costin,
>
> costinm@covalent.net wrote:
> > Patrick ( if you read this ) - what's the status with the 'guess home' ?
> > I can use IntrospectionUtils - it has the whole thing in it ( home/base
> > setting, find in classpath ). We already need IU for jk - it just needs
> > to be included in bootstrap.jar to do that.
> >
>
> I haven't ported this yet but I can do it very quickly. The question is
> where should we put it? Originally, I was going to put it in the
> Bootstrap.getCatalinaHome() method. However, since we are moving towards
> using CatalinaService, do you think I should put it there?
Probably Bootrstrap is the best place - since it needs to construct the
classpath to load CatalinaService ( so it needs it ).
If you just include IntrospectionUtil from j-t-c you get it all -
( it is used in jk already ). All you need ( besides build.xml changes )
is:
home= IntrospectionUtils.guessInstall("catalina.home", "catalina.base",
"bootstrap.jar",
"org.apache.catalina.startup.CatalinaService");
That will set catalina.home/catalina.base:
- if only one is set the other will take that value.
- if none is set, it'll look in CLASSPATH for bootstrap.jar and go one
level up, or for org/apache... if classes/ is used - and set catalina.home
fromt that.
You don't need to port it - it is useable directly. ( well, you can
cut&paste the method if you want, it's independent of the rest )
Costin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by Patrick Luby <pa...@sun.com>.
Costin,
costinm@covalent.net wrote:
> Patrick ( if you read this ) - what's the status with the 'guess home' ?
> I can use IntrospectionUtils - it has the whole thing in it ( home/base
> setting, find in classpath ). We already need IU for jk - it just needs
> to be included in bootstrap.jar to do that.
>
I haven't ported this yet but I can do it very quickly. The question is
where should we put it? Originally, I was going to put it in the
Bootstrap.getCatalinaHome() method. However, since we are moving towards
using CatalinaService, do you think I should put it there?
Patrick
--
________________________________________________________________
Patrick Luby Email: patrick.luby@sun.com
Sun Microsystems Phone: 408-276-7471
901 San Antonio Road, USCA14-303
Palo Alto, CA 94303-4900
________________________________________________________________
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by co...@covalent.net.
On Wed, 14 Aug 2002, Steve Downey wrote:
> See attached patch. I added a method setHomeAndBase() and a couple of
> booleans to see if they were set via setters.
Ok. I made few changes, I'll commit later.
Patrick ( if you read this ) - what's the status with the 'guess home' ?
I can use IntrospectionUtils - it has the whole thing in it ( home/base
setting, find in classpath ). We already need IU for jk - it just needs
to be included in bootstrap.jar to do that.
> With any luck, by the time Tomcat5 is released, XML parsers with good
> schema support will be more common, so it won't be such an issue. It is
> unfortunate that the current release of Xerces is broken.
I kind of doubt too many parsers will support schema - it is a very heavy
specification. And unless JDK1.5 is released by then, the parser included
in jdk1.4 will not support schema.
> Removing validation from the servlet container reference implementation
> somehow seems, well, wrong. I agree that doing validation at deployment
> is reasonable, rather than for each startup. Something like what the jsp
> compiler does.
It's not 'removing' - just moving to the right place. And doing it
at runtime ( and on every startup ) sets a bad example, for a RI :-)
> <java fork="false"> will run it in process, which gives problems with
> the shared environment. In particular I get:
> [java] INFO: Digester for server.xml created 587
> [java] java.lang.LinkageError: loader constraints violated when
> linking org/xml/sax/XMLReader class
Yes, that's a bug in ant1.5 class loader. I assume you use jdk1.4 :-)
It works ( for me ) with CVS head.
> <java fork="true"> will run it out of process, but the next task won't
> execute until tomcat finishes. Not good either.
I'll think about it. I can fix <java> to wait for a token and detach
( or at least return control ).
> I think the right answer is either Launcher, which uses [daemon] to
> start a background process, or Cactus, which introduces another
>From what I see in the [daemon] code it won't solve the problem -
on unix it seems to wait in a loop, it won't return.
I need to try again.
I'm not sure how is cactus solving the problem.
Costin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by Steve Downey <st...@netfolio.com>.
costinm@covalent.net wrote:
><SNIP/>
>
>
>Well, CatalinaService is not 'completed' - just started :-)
>
>What we do in 3.3 is have 2 setters, and at execute check if:
>- if only one is set, the other takes this value
>- if none is set, use discovery ( locate the base from the CLASSPATH )
>- if both are set, use that.
>
>If you want to implement this - great, if not I'll do it when I find
>time ( or I need it ).
>
See attached patch. I added a method setHomeAndBase() and a couple of
booleans to see if they were set via setters.
>
>>The next problem was that the task runs in VM. Ant's xercesImpl chokes
>>on parsing the schemas. This is the known dependency on Xerces 2.0.1.
>>Replacing the xercesImpl.jar in Ant fixed that, but that seems an ugly
>>requirement.
>>
>
>Well... As I said, it is a major problem if we can't use any JAXP but
>require a specific parser and version...
>
>One solution is to remove schema validation ( and validation in general )
>from tomcat runtime, and have a separate validation program that
>can be run on a webapp _before_ it is deployed on tomcat.
>
>There are many other solutions - but requiring anyone using tomcat5
>to use Xerces2.0.1 and subjecting every user to hugely expensive
>and redundant validation is the worse.
>
With any luck, by the time Tomcat5 is released, XML parsers with good
schema support will be more common, so it won't be such an issue. It is
unfortunate that the current release of Xerces is broken.
Removing validation from the servlet container reference implementation
somehow seems, well, wrong. I agree that doing validation at deployment
is reasonable, rather than for each startup. Something like what the jsp
compiler does.
>
><SNIP>
>
<java fork="false"> will run it in process, which gives problems with
the shared environment. In particular I get:
[java] INFO: Digester for server.xml created 587
[java] java.lang.LinkageError: loader constraints violated when
linking org/xml/sax/XMLReader class
<java fork="true"> will run it out of process, but the next task won't
execute until tomcat finishes. Not good either.
I think the right answer is either Launcher, which uses [daemon] to
start a background process, or Cactus, which introduces another
dependency, and may still have some issues with the ant environment
leaking through.
>
>
>Regarding output redirection, I think Patrick mentioned adding some
>methods in the startup code to redirect programmatically.
>
>Costin
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
Re: [5.0] CL delegation order (was: Re: [5][PATCH]Run Watchdog from
the jakarta-tomcat-5 build.xml)
Posted by co...@covalent.net.
On Wed, 14 Aug 2002, Remy Maucherat wrote:
> costinm@covalent.net wrote:
> > I agree it is valuable in some cases to not delegate - but we've
> > seen far too many problems. It's better to let those who
> > really need this and know what they're doing turn this on.
>
> The thing is that it looks like a terrific idea, but in the end it's not
> so good once it is implemented.
Sometimes is more usefull to have fine control.
I think it may be better to just change the order - i.e. the loader
should default to 'delegate' for everything but be able to exclude
specific packages ( right now it is the reverse ).
What's important is to support the MANIFEST entries - and for that
it may be needed to override some of the stuff from the common
loader.
Now - if you are going to work on that, it may be a good idea to
try to move the loader in a separate dir ( commons-style ) and
merge the 2 loaders ( there's a lot of duplicated code ). I'm not
saying to move it in commons yet, but at least have it useable
independently. I would love to add few hooks and use it in ant...
Costin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5.0] CL delegation order (was: Re: [5][PATCH]Run Watchdog from
the jakarta-tomcat-5 build.xml)
Posted by Remy Maucherat <re...@apache.org>.
costinm@covalent.net wrote:
> I agree it is valuable in some cases to not delegate - but we've
> seen far too many problems. It's better to let those who
> really need this and know what they're doing turn this on.
The thing is that it looks like a terrific idea, but in the end it's not
so good once it is implemented.
(I have to apologize a bit for the tone of the previous email, which was
mostly caused by months of frustration :-P)
> BTW, ant has also deprecated the 'reverse' loader, due to
> too many problems.
Remy
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5.0] CL delegation order (was: Re: [5][PATCH]Run Watchdog from
the jakarta-tomcat-5 build.xml)
Posted by co...@covalent.net.
On Wed, 14 Aug 2002, Remy Maucherat wrote:
> costinm@covalent.net wrote:
> > I love classloaders and reverse delegation...
>
> Speaking of which, I think we should stop using the delegation scheme
> recommended by the servlet spec (ie, look first in own repositories,
> then delegate). The idea is that it is only recommended, it is
> essentially broken and is creating a lot of problems.
> I also do not believe that overriding shared libraries is a valid use
> case for the average Tomcat user.
>
> So I propose that:
> - the default for the webapp CL is to set "delegate" to "true"
> - as before, the value of "delegate" can be changed in server.xml
>
> <ballot>
> +1 [X] Yes, CL delegation should follow the standard model
> -1 [ ] No, the webapp CL shouldn't delegate first, keeping the
> recommended model in the spec (which is convenient but broken)
> </ballot>
I agree it is valuable in some cases to not delegate - but we've
seen far too many problems. It's better to let those who
really need this and know what they're doing turn this on.
BTW, ant has also deprecated the 'reverse' loader, due to
too many problems.
Costin
>
> Remy
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
[5.0] CL delegation order (was: Re: [5][PATCH]Run Watchdog from the
jakarta-tomcat-5 build.xml)
Posted by Remy Maucherat <re...@apache.org>.
costinm@covalent.net wrote:
> I love classloaders and reverse delegation...
Speaking of which, I think we should stop using the delegation scheme
recommended by the servlet spec (ie, look first in own repositories,
then delegate). The idea is that it is only recommended, it is
essentially broken and is creating a lot of problems.
I also do not believe that overriding shared libraries is a valid use
case for the average Tomcat user.
So I propose that:
- the default for the webapp CL is to set "delegate" to "true"
- as before, the value of "delegate" can be changed in server.xml
<ballot>
+1 [ ] Yes, CL delegation should follow the standard model
-1 [ ] No, the webapp CL shouldn't delegate first, keeping the
recommended model in the spec (which is convenient but broken)
</ballot>
Remy
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by co...@covalent.net.
On Wed, 14 Aug 2002, Steve Downey wrote:
> First is that o.a.c.startup.CatalinaService doesn't distinguish between
> catalina.home and catalina.base. setHome() actually sets both of them.
> Adding a setBase() is trivial, but it affects the semantics of
> initialization. Any current client expects both to be set by a call to
> setHome(), and just moving the setProperty to setBase() breaks that. Of
> course if the setProperty("catalina.base",s) is left in setHome(), then
> initialization is order dependent. For now, and I just added a setBase()
> and ignored the problem.
Well, CatalinaService is not 'completed' - just started :-)
What we do in 3.3 is have 2 setters, and at execute check if:
- if only one is set, the other takes this value
- if none is set, use discovery ( locate the base from the CLASSPATH )
- if both are set, use that.
If you want to implement this - great, if not I'll do it when I find
time ( or I need it ).
> The next problem was that the task runs in VM. Ant's xercesImpl chokes
> on parsing the schemas. This is the known dependency on Xerces 2.0.1.
> Replacing the xercesImpl.jar in Ant fixed that, but that seems an ugly
> requirement.
Well... As I said, it is a major problem if we can't use any JAXP but
require a specific parser and version...
One solution is to remove schema validation ( and validation in general )
from tomcat runtime, and have a separate validation program that
can be run on a webapp _before_ it is deployed on tomcat.
There are many other solutions - but requiring anyone using tomcat5
to use Xerces2.0.1 and subjecting every user to hugely expensive
and redundant validation is the worse.
> In any case, after doing that, Catalina service starts up, but doesn't
> seem to be able to find the servlet apis to compile JSP pages. As an
> added irritation, stdout isn't redirected to catalina.out, and it is
> quite noisy.
Yes - I have few more classes to convert to commons-logging, after
that we'll have full control over the messages and verbosity.
I'll probably commit somthing this weekend ( large commit, need
to filter out some changes and test more ).
Regarding servlet apis - it may be a bug in AnClasstLoader. I use CVS_HEAD
and it works fine for me, but I had the same problem with 1.5.
I can try to find a workaround ( I think I've seen a fix in the 1.5
branch for classloader that may fix this, so you can use the head
of 1.5 branch as well ).
I love classloaders and reverse delegation...
> So, my current patch may not be the best possible, but it does have the
> advantage of working.
Ok.
> I think it will make more sense to use the launcher as the basis for a
> task to run tomcat. Running it in process leads to a lot of state
> leaking over. For testing I think it's safer to run it as much as
> possible in its own environment.
You can also use <java execute> ( it is commented out in build2.xml,
but should work fine ).
Regarding output redirection, I think Patrick mentioned adding some
methods in the startup code to redirect programmatically.
Costin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by Steve Downey <st...@netfolio.com>.
Thanks for pointing the tomcat5 task out. I'm trying to reimplement with
that, and have run into a couple of snags.
First is that o.a.c.startup.CatalinaService doesn't distinguish between
catalina.home and catalina.base. setHome() actually sets both of them.
Adding a setBase() is trivial, but it affects the semantics of
initialization. Any current client expects both to be set by a call to
setHome(), and just moving the setProperty to setBase() breaks that. Of
course if the setProperty("catalina.base",s) is left in setHome(), then
initialization is order dependent. For now, and I just added a setBase()
and ignored the problem.
The next problem was that the task runs in VM. Ant's xercesImpl chokes
on parsing the schemas. This is the known dependency on Xerces 2.0.1.
Replacing the xercesImpl.jar in Ant fixed that, but that seems an ugly
requirement.
In any case, after doing that, Catalina service starts up, but doesn't
seem to be able to find the servlet apis to compile JSP pages. As an
added irritation, stdout isn't redirected to catalina.out, and it is
quite noisy.
So, my current patch may not be the best possible, but it does have the
advantage of working.
I think it will make more sense to use the launcher as the basis for a
task to run tomcat. Running it in process leads to a lot of state
leaking over. For testing I think it's safer to run it as much as
possible in its own environment.
This is what I was using for the tomcat5 task:
<property name="tools.jar"
location="${java.home}/../lib/tools.jar" />
<path id="tomcatcp" >
<pathelement location="${tomcat.build}/server/classes"/>
<pathelement location="${tools.jar}" />
<fileset dir="${tomcat.build}/server/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcat.build}/common/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcat.build}/common/endorsed">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcat.build}/shared/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef name="tomcat5"
classname="org.apache.catalina.startup.CatalinaService"
classpathref="tomcatcp" />
<tomcat5 do="start"
home="${tomcat.build}"
base="${basedir}/tmp/tomcat"
wait="false"/>
costinm@covalent.net wrote:
>On Wed, 14 Aug 2002, Steve Downey wrote:
>
>>This patch starts up a copy of tomcat with the watchdog war files, runs
>>watchdog against it, and shuts down tomcat afterwards. It uses the Launcher
>>to run tomcat in the background, and puts the webapps, work, logs and conf
>>directories in a tmp dir so as not to muck up the build.
>>
>>The only part I really don't like is that there isn't a good way to know that
>>tomcat is up and running, so for now there's a sleep between launching tomcat
>>and starting the watchdog tests.
>>
>
>For tomcat5 ? Well, it is - if you use the task ( take a look at
>build2.xml ). The task will start tomcat inprocess, and will return
>after all the startup is done ( and continue with the next task ).
>
>( unless you have wait="true" )
>
>Costin
>
>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [5][PATCH]Run Watchdog from the jakarta-tomcat-5 build.xml
Posted by co...@covalent.net.
On Wed, 14 Aug 2002, Steve Downey wrote:
> This patch starts up a copy of tomcat with the watchdog war files, runs
> watchdog against it, and shuts down tomcat afterwards. It uses the Launcher
> to run tomcat in the background, and puts the webapps, work, logs and conf
> directories in a tmp dir so as not to muck up the build.
>
> The only part I really don't like is that there isn't a good way to know that
> tomcat is up and running, so for now there's a sleep between launching tomcat
> and starting the watchdog tests.
For tomcat5 ? Well, it is - if you use the task ( take a look at
build2.xml ). The task will start tomcat inprocess, and will return
after all the startup is done ( and continue with the next task ).
( unless you have wait="true" )
Costin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>