From: david w <david.wooffin...@gmail.com>
Sent: Thursday, November 7, 2024 2:09 PM
To: Tomcat Users List <users@tomcat.apache.org>
Subject: Re: Tomcat Service(s) on Windows, Procmon question

________________________________ Sent: Thursday, November 7, 2024 8: 53 PM To: 
Tomcat Users List <users@ tomcat. apache. org> Subject: RE: Tomcat Service(s) 
on Windows, Procmon question Sorry to top-reply, but does this regression exist 
in








________________________________

Sent: Thursday, November 7, 2024 8:53 PM

To: Tomcat Users List <users@tomcat.apache.org<mailto:users@tomcat.apache.org>>

Subject: RE: Tomcat Service(s) on Windows, Procmon question



Sorry to top-reply, but does this regression exist in 10.1.31 as well, or only 
9.0.96?



From: Christopher Schultz 
<ch...@christopherschultz.net<mailto:ch...@christopherschultz.net>>

Sent: Thursday, November 7, 2024 1:16 PM

To: users@tomcat.apache.org<mailto:users@tomcat.apache.org>

Subject: Re: Tomcat Service(s) on Windows, Procmon question



Jon, On 11/7/24 13: 08, Mcalexander, Jon J. wrote: > Happy Thursday everybody, 
> > I have a question around starting a Tomcat Service Instance on Windows 
servers. Is there a way to have the Tomcat Startup kick off a script before 
starting





Jon,







On 11/7/24 13:08, Mcalexander, Jon J. wrote:



> Happy Thursday everybody,



>



> I have a question around starting a Tomcat Service Instance on Windows 
> servers. Is there a way to have the Tomcat Startup kick off a script before 
> starting that will clear the contents of the workDir (Clear the cache so to 
> say)?



>



> We have run into some issues after upgrading our binaries to Tomcat 9.0.96 
> where applications start throwing some unknown method errors when starting. 
> The fix for this was to clear the workDir contents before startup and let 
> Tomcat do it's recompile steps. Note, the app didn't change, but the binaries 
> did.







Please note that there is a regression in 9.0.96 that you need to be



aware of that affects JSPs. It will affect you, since you are reporting



(a) missing method errors and (b) you want to clear your work directory,



presumably to remove .jsp -> .java -> .class files to trigger



recompilation of all of those.







I would pause and NOT deploy 9.0.96 because recompilation will stop the



app from throwing those missing-method errors, but some tags might



actually not behave properly.







> We separate our CATALINA_HOME from our CATALINA_BASE, so app teams just need 
> to restart their instance after the upgrade.



>



> Doing this in Linux/Unix/MAC, is easier as we can do this with the setenv.sh 
> script or in the startup or shutdown scripts. However Windows is more 
> difficult as the instance runs as a service.



>



> Any help here would be much appreciated.







As to your question about procrun running a script before it launches



Tomcat, I think the short answer is "no" but I do have an idea for you.







Create a new service called Tomcat-cleanup, make it a simply BAT/PS



script that cleans-out that directory, and make it a startup dependency



of the real Tomcat service.







-chris











You can also create a scheduled task that starts every time a Windows service 
starts and this task could run your script for you.

this script would require possibly administrator rights in order to actually 
perform any file operations that your script would need to do, but this is your 
call and it wouldn’t compromise the tomcat service or service account so could 
be an alternative.

David



---------------------------------------------------------------------



To unsubscribe, e-mail: 
users-unsubscr...@tomcat.apache.org<mailto:users-unsubscr...@tomcat.apache.org<mailto:users-unsubscr...@tomcat.apache.org%3cmailto:users-unsubscr...@tomcat.apache.org>>



For additional commands, e-mail: 
users-h...@tomcat.apache.org<mailto:users-h...@tomcat.apache.org<mailto:users-h...@tomcat.apache.org%3cmailto:users-h...@tomcat.apache.org>>





[Mcalexander, Jon J.]

Thanks David, will test that out!

Reply via email to