You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joachim Wackerow <wa...@zuma-mannheim.de> on 2005/01/13 10:43:50 UTC

Getting a generator class to reload

I am writing a custom generator. It would be convenient to reload the 
class while Cocoon is running.

How it is possible to reload just a generator class in Cocoon 2.1.6 
running in Tomcat 5.x or 5.5, without reloading the whole Cocoon or 
without restarting Tomcat (ca. 30 sec)?

The generator class is in $TOMCAT_HOME/webapps/cocoon-2.1.6/WEB-INF/classes.

This question was already asked in January 2003, but I didn't found a 
working solution. See thread:
http://archives.real-time.com/pipermail/cocoon-users/2003-January/028203.html

Any help is appreciated.

Achim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Getting a generator class to reload

Posted by Nouguier Olivier <ol...@wanadoo.fr>.
Hi Achim,
  I don't think it reload all the context as the reload is immediately
effective.
  It works for component ( cocoon, struts ), I've just tried with
servlet with this code, and it's okai.
http://www.orcades.net/contrib/reloader-webapp.zip . The server.xml is
the vanilla one.

IMHO it this useful behaviour is eclipse concerned ( Dark Classloader
story perhaps ). If you find a better explanation I'm interested ;}

On Fri, 2005-01-21 at 14:09 +0100, Joachim Wackerow wrote:
> Olivier
> 
> This sounds interesting and like a great help for the development. Now 
> I'm wondering, if this mechanism does really reload only the generator 
> class of Cocoon, or if it does reload the Tomcat web application, i.e. 
> Cocoon itself. Does this mechanism use the servlet reloading facility of 
> Tomcat? The documentation of the Eclipse Tomcat plugin lets assume this.
> 
> Do you develop servlets for Tomcat or especially generators for Cocoon?
> Could you perhaps provide the specific part of the Tomcat server.xml, so 
> I could understand the mechanism more?
> 
> Achim
> 
> 
> Nouguier Olivier wrote:
> 
> > Hi all,
> >  A very simple way is to start tomcat within eclipse ( sysdeo plugin
> > http://www.sysdeo.com/eclipse/tomcatPlugin.html ).
> > Tomcat must be started when last version of your classes lives in the
> > WEB-INF/classes. ( using ant )
> > 
> > So the sequence *MUST* be:
> > 
> >   1: copy classes in WEB-INF/classes
> >   2: start tomcat
> >   3: work on *.java in eclipse.
> > 
> >  In this condition:
> >   - a: you can debug your component.
> >   - b: every changes in your code is immediatly reported in tomcat
> > process, very fun.
> > 
> > AFAIK 1.4 jdk classloader feature doesn-t support classes interface
> > modification, so if you change the class signature of a class (ie your
> > generator) by add field/method or changing something outside the body of
> > a method you will have to stop tomcat and replay sequence (1,2,3).
> > 
> > Don't hesitate to ask me if you encounter problem. It's work for me and
> > it really wonderful.
> > 
> > 
> > 
> > On Thu, 2005-01-13 at 10:43 +0100, Joachim Wackerow wrote:
> > 
> >>I am writing a custom generator. It would be convenient to reload the 
> >>class while Cocoon is running.
> >>
> >>How it is possible to reload just a generator class in Cocoon 2.1.6 
> >>running in Tomcat 5.x or 5.5, without reloading the whole Cocoon or 
> >>without restarting Tomcat (ca. 30 sec)?
> >>
> >>The generator class is in $TOMCAT_HOME/webapps/cocoon-2.1.6/WEB-INF/classes.
> >>
> >>This question was already asked in January 2003, but I didn't found a 
> >>working solution. See thread:
> >>http://archives.real-time.com/pipermail/cocoon-users/2003-January/028203.html
> >>
> >>Any help is appreciated.
> >>
> >>Achim
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >>For additional commands, e-mail: users-help@cocoon.apache.org
> >>
> >>
> > 
> > http://www.orcades.net
> > 
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
http://www.orcades.net




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Getting a generator class to reload

Posted by Joachim Wackerow <wa...@zuma-mannheim.de>.
Olivier

This sounds interesting and like a great help for the development. Now 
I'm wondering, if this mechanism does really reload only the generator 
class of Cocoon, or if it does reload the Tomcat web application, i.e. 
Cocoon itself. Does this mechanism use the servlet reloading facility of 
Tomcat? The documentation of the Eclipse Tomcat plugin lets assume this.

Do you develop servlets for Tomcat or especially generators for Cocoon?
Could you perhaps provide the specific part of the Tomcat server.xml, so 
I could understand the mechanism more?

Achim


Nouguier Olivier wrote:

> Hi all,
>  A very simple way is to start tomcat within eclipse ( sysdeo plugin
> http://www.sysdeo.com/eclipse/tomcatPlugin.html ).
> Tomcat must be started when last version of your classes lives in the
> WEB-INF/classes. ( using ant )
> 
> So the sequence *MUST* be:
> 
>   1: copy classes in WEB-INF/classes
>   2: start tomcat
>   3: work on *.java in eclipse.
> 
>  In this condition:
>   - a: you can debug your component.
>   - b: every changes in your code is immediatly reported in tomcat
> process, very fun.
> 
> AFAIK 1.4 jdk classloader feature doesn-t support classes interface
> modification, so if you change the class signature of a class (ie your
> generator) by add field/method or changing something outside the body of
> a method you will have to stop tomcat and replay sequence (1,2,3).
> 
> Don't hesitate to ask me if you encounter problem. It's work for me and
> it really wonderful.
> 
> 
> 
> On Thu, 2005-01-13 at 10:43 +0100, Joachim Wackerow wrote:
> 
>>I am writing a custom generator. It would be convenient to reload the 
>>class while Cocoon is running.
>>
>>How it is possible to reload just a generator class in Cocoon 2.1.6 
>>running in Tomcat 5.x or 5.5, without reloading the whole Cocoon or 
>>without restarting Tomcat (ca. 30 sec)?
>>
>>The generator class is in $TOMCAT_HOME/webapps/cocoon-2.1.6/WEB-INF/classes.
>>
>>This question was already asked in January 2003, but I didn't found a 
>>working solution. See thread:
>>http://archives.real-time.com/pipermail/cocoon-users/2003-January/028203.html
>>
>>Any help is appreciated.
>>
>>Achim
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
> 
> http://www.orcades.net
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Getting a generator class to reload

Posted by Nouguier Olivier <ol...@wanadoo.fr>.
Hi all,
 A very simple way is to start tomcat within eclipse ( sysdeo plugin
http://www.sysdeo.com/eclipse/tomcatPlugin.html ).
Tomcat must be started when last version of your classes lives in the
WEB-INF/classes. ( using ant )

So the sequence *MUST* be:

  1: copy classes in WEB-INF/classes
  2: start tomcat
  3: work on *.java in eclipse.

 In this condition:
  - a: you can debug your component.
  - b: every changes in your code is immediatly reported in tomcat
process, very fun.

AFAIK 1.4 jdk classloader feature doesn-t support classes interface
modification, so if you change the class signature of a class (ie your
generator) by add field/method or changing something outside the body of
a method you will have to stop tomcat and replay sequence (1,2,3).

Don't hesitate to ask me if you encounter problem. It's work for me and
it really wonderful.



On Thu, 2005-01-13 at 10:43 +0100, Joachim Wackerow wrote:
> I am writing a custom generator. It would be convenient to reload the 
> class while Cocoon is running.
> 
> How it is possible to reload just a generator class in Cocoon 2.1.6 
> running in Tomcat 5.x or 5.5, without reloading the whole Cocoon or 
> without restarting Tomcat (ca. 30 sec)?
> 
> The generator class is in $TOMCAT_HOME/webapps/cocoon-2.1.6/WEB-INF/classes.
> 
> This question was already asked in January 2003, but I didn't found a 
> working solution. See thread:
> http://archives.real-time.com/pipermail/cocoon-users/2003-January/028203.html
> 
> Any help is appreciated.
> 
> Achim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
http://www.orcades.net




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Getting a generator class to reload

Posted by Leszek Gawron <lg...@apache.org>.
Joachim Wackerow wrote:
> I am writing a custom generator. It would be convenient to reload the 
> class while Cocoon is running.
> 
> How it is possible to reload just a generator class in Cocoon 2.1.6 
> running in Tomcat 5.x or 5.5, without reloading the whole Cocoon or 
> without restarting Tomcat (ca. 30 sec)?
> 
> The generator class is in 
> $TOMCAT_HOME/webapps/cocoon-2.1.6/WEB-INF/classes.
> 
> This question was already asked in January 2003, but I didn't found a 
> working solution. See thread:
> http://archives.real-time.com/pipermail/cocoon-users/2003-January/028203.html 
> 
> 
> Any help is appreciated.
> 
> Achim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
I'm not Avalon pro but I do not think that feature is possible without 
reloading the whole webapp

-- 
Leszek Gawron                                                 MobileBox
lgawron@apache.org                              http://www.mobilebox.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org