You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bo Xu <bo...@cybershop.ca> on 2001/06/16 23:57:17 UTC

about auto-reloading of TC4.0-b5

Hi :-)

* I use the foolowing symbol to try to explain my question :-)
   MyServlet(0):  a old version of MyServlet
   MyServlet(1):  a new version of MyServlet
   MyServlet(2):  a newer(more) version of MyServlet
   MyServlet(3):  a newer(more more...) version of MyServlet
   ...
   but: as a file, all MyServlet(i)s have the same name: MyServlet.class

* if:
   - MyServlet(0) is in MyJar.jar
   - MyJar.jar is in WEB-INF/lib
   - and at the same time, MyServlet(1) is in WEB-INF/classes

* then:
   - when I start TC4.0-b5, and "make the first-time invoking to
      myapp/servlet/MyServlet", MyServlet(1) is loaded and invoked.

   from the following email, I can explain it:
   //***************************************************
   ...
  (2.3 requirement only) Classes and resources in /WEB-INF/classes
  override classes and resources with the same name under
  /WEB-INF/lib.
   ...
   Craig McClanahan
//***************************************************

* but:
  - now I update MyServlet in WEB-INF/classes: I copy
    MyServlet(2) into myapp/WEB-INF/classes to replace MyServlet(1)
  - I don't change anything in WEB-INF/lib

* now I find:
  - if I don't restart TC4.0-b5, I can not auto-reloading MyServlet(2):
    MyServlet(1) is still invoked
  - if I  restart TC4.0-b5, now MyServlet(2) is invoked

* if I delete MyJar.jar, and restart TC4.0-b5, now auto-reloading works:

   I can auto-reload MyServlet(i)

* I guess the reason is:
  - if MyServlet(0) is in a jar file in myapp/WEB-INF/lib, it will be
"overrided"
    by the another MyServlet(i) which is in myapp/WEB-INF/classes
  - but perhaps it will "prevent" auto-relaoding of MyServlet(i) which
is in
    myapp/WEB-INF/classes
  - this is not a "frequency-case", because people will not put
MyServlet both
    in WEB-INF/classes and WEB-INF/lib, several days ago I put
MyServlet(0)
    in MyJar.jar in WEB-INF/lib for a testing, but I forgot to delete it
after I finish
   the testing, but today I try to update MyServlet(i) in
WEB-INF/classes, and/but
    I find I can not auto-reload it,  finally I delete MyJar.jar, now I
can auto-reload
    MyServlet(i) :-)



Bo
June 16, 2001




Re: about auto-reloading of TC4.0-b5

Posted by Luba Powell <lu...@bellatlantic.net>.
Thank you.  I'll try it on Monday.

----- Original Message ----- 
From: "Bo Xu" <bo...@cybershop.ca>
To: <to...@jakarta.apache.org>
Sent: Saturday, June 16, 2001 5:57 PM
Subject: about auto-reloading of TC4.0-b5


> Hi :-)
> 
> * I use the foolowing symbol to try to explain my question :-)
>    MyServlet(0):  a old version of MyServlet
>    MyServlet(1):  a new version of MyServlet
>    MyServlet(2):  a newer(more) version of MyServlet
>    MyServlet(3):  a newer(more more...) version of MyServlet
>    ...
>    but: as a file, all MyServlet(i)s have the same name: MyServlet.class
> 
> * if:
>    - MyServlet(0) is in MyJar.jar
>    - MyJar.jar is in WEB-INF/lib
>    - and at the same time, MyServlet(1) is in WEB-INF/classes
> 
> * then:
>    - when I start TC4.0-b5, and "make the first-time invoking to
>       myapp/servlet/MyServlet", MyServlet(1) is loaded and invoked.
> 
>    from the following email, I can explain it:
>    //***************************************************
>    ...
>   (2.3 requirement only) Classes and resources in /WEB-INF/classes
>   override classes and resources with the same name under
>   /WEB-INF/lib.
>    ...
>    Craig McClanahan
> //***************************************************
> 
> * but:
>   - now I update MyServlet in WEB-INF/classes: I copy
>     MyServlet(2) into myapp/WEB-INF/classes to replace MyServlet(1)
>   - I don't change anything in WEB-INF/lib
> 
> * now I find:
>   - if I don't restart TC4.0-b5, I can not auto-reloading MyServlet(2):
>     MyServlet(1) is still invoked
>   - if I  restart TC4.0-b5, now MyServlet(2) is invoked
> 
> * if I delete MyJar.jar, and restart TC4.0-b5, now auto-reloading works:
> 
>    I can auto-reload MyServlet(i)
> 
> * I guess the reason is:
>   - if MyServlet(0) is in a jar file in myapp/WEB-INF/lib, it will be
> "overrided"
>     by the another MyServlet(i) which is in myapp/WEB-INF/classes
>   - but perhaps it will "prevent" auto-relaoding of MyServlet(i) which
> is in
>     myapp/WEB-INF/classes
>   - this is not a "frequency-case", because people will not put
> MyServlet both
>     in WEB-INF/classes and WEB-INF/lib, several days ago I put
> MyServlet(0)
>     in MyJar.jar in WEB-INF/lib for a testing, but I forgot to delete it
> after I finish
>    the testing, but today I try to update MyServlet(i) in
> WEB-INF/classes, and/but
>     I find I can not auto-reload it,  finally I delete MyJar.jar, now I
> can auto-reload
>     MyServlet(i) :-)
> 
> 
> 
> Bo
> June 16, 2001
> 
> 
>