From: Adrien Guillon <[EMAIL PROTECTED]>
Date: Tue, 2 May 2006 11:00:11 -0400
Hello All,
I posted on the cocoon-user list regarding this topic, and I will
respond
to that post with a solution once I find one.
Basically, I am experimenting with writing my own actions / generators
/
transformers to extend Cocoon for my needs. These are written in Java, and
compiled to class files. However, I have noticed that recompiling the
class
file, and placing it back into WEB-INF/classes does not mean that the
changes
are picked up immediately. I can force this with a restart of Cocoon.
However, this instance of Cocoon is already in production, so a restart is
not always possible.
If it's that important to avoid downtime in your production system, is it
load balanced across two (or more) servers? Not only will that protect you
against a server crash, but each one could take over serving the site while
you restart the other...
I have defined my own sub-sitemap for development, and
leave the production side alone.
Still sounds risky to me. You may plan to only work in your own
sub-sitemap, but it's practically inevitable that one day you'll edit the
wrong sitemap by mistake and break the live site. Heck, even if you are
editing the right one you can still drag down the production site with a
badly performing pipeline. All it takes is e.g. a pipeline aggregation that
includes a map:call to itself, or an XSL with a dodgy xsl:template that
writes out an entire >1 megabyte input document for every contained element,
and you could crash the whole application with an OutOfMemoryError...
Is there a way to force Cocoon to reload these class files, or is a
restart
the only option? The only other alternative I see right now, is to copy
Cocoon to another server and do my development there (which I would rather
not do).
That sounds the safest approach to me, but then again I'm not paying for the
extra hardware ;-) Only you know if the (admittedly slight) extra risk is
acceptable.
As to your question about reloading, are you using the ParanoidCocoonServlet
(which manages its own classloader) or the standard one? What container are
you running in? Class reloading is probably a container-specific
configuration issue; I know that in Websphere 5 you can enable/disable it at
the application level. You'll probably find that reloading still involves a
restart of the app, though, to make sure none of the running servlets &
filters are using the old class definitions. Also, you could try adding a
?cocoon-reload=true parameter on any request if that's enabled in the Cocoon
configuration, but I believe it's normally switched of by default to avoid
potential DOS attacks from somebody forcing endless restarts of an app in
production.
Andrew.