On 28/09/2010 07:31, jmorati...@dit.upm.es wrote: > Yes Rainer, just what you say. > > I know that using watchresource will restart all servlets. I just want to > restart one servlet, not all. > > Does tomcat provide a solution to restart a specified servlet when a > resource changes??? I don't want to get all my web application restarted. > > Another behaviour I would like to avoid is when restarting, a new > classloader is used to restart servlets. Is there a way to avoid a new > classloader reload the servlets??? This behaviour is making my singleton > classes don't behave as singletons.
When a webapp is initialised or reinitialised a new classloader is created. The reloading mechanism is for the app, not individual servlets. Maybe you just need to choose another design pattern, instead of Singleton. p >>> On 27.09.2010 15:42, jmorati...@dit.upm.es wrote: >>>> >>>> Many thanks Caldarale. I'm working with tomcat 6, but a I was looking >>>> so >>>> quickly for an answer that I didn't realise that it was the tomcat 3.2 >>>> user manual, but that explained me what happened. >>>> >>>> I think that<WatchedResource> will help me for this kind of tasks >>> >>> Note that the watched resources means Tomcat will reload the webapp. I >>> had the impression, you wanted to use a self-made mechanism that watches >>> a resource and does some internal reconfiguration when the resource >>> changes - but not a complete reload of the webapp. >>> >>> Regards, >>> >>> Rainer >>> >>> >>>>> From: jmorati...@dit.upm.es [mailto:jmorati...@dit.upm.es] >>>>> Subject: Re: About ContainerBackgroundProcessor thread >>>>> >>>>> >>>>> Here is the explanation I found: >>>>> http://tomcat.apache.org/tomcat-3.2-doc/uguide/tomcat_ug.html >>>>> >>>>> You can't seriously be using Tomcat 3.2, are you? That hasn't been >>>>> supported for eons. >>>>> >>>>> In regards to your original question, if the reloadable attribute of >>>>> the >>>>> <Context> element is set to true, Tomcat will monitor /classes/ to >>>>> see >>>>> if >>>>> the webapp has been updated. To quote from current documentation: >>>>> >>>>> "Set to true if you want Catalina to monitor classes in >>>>> /WEB-INF/classes/ >>>>> and /WEB-INF/lib for changes, and automatically reload the web >>>>> application >>>>> if a change is detected. This feature is very useful during >>>>> application >>>>> development, but it requires significant runtime overhead and is not >>>>> recommended for use on deployed production applications." >>>>> >>>>> You can also use a nested<WatchedResource> element to trigger reloads >>>>> for >>>>> other files; the default is just WEB-INF/web.xml. If you don't set >>>>> reloadable and don't specify the file as a<WatchedResource>, Tomcat >>>>> should not attempt to do anything with the webapp once it's started. >>>>> >>>>> But if you really are using Tomcat 3.2, I have no idea what it's >>>>> behavior >>>>> should be; move up to a supported level. >>>>> >>>>> - Chuck >>>>> >>>>> >>>>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE >>>>> PROPRIETARY >>>>> MATERIAL and is thus for use only by the intended recipient. If you >>>>> received this in error, please contact the sender and delete the >>>>> e-mail >>>>> and its attachments from all computers. >>>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >>> For additional commands, e-mail: users-h...@tomcat.apache.org >>> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org >
0x62590808.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature