From: Christopher Schultz <ch...@christopherschultz.net> Sent: Thursday, November 7, 2024 1:16 PM To: 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. [Mcalexander, Jon J.] Thanks for this information Chris. I can probably create this dependency, but then I wouldn’t want it to be running all the time, will having it as a dependency start said service? I could use Procrun to probably do this service, but then how do I tell it to run and then stop? Thanks, -chris --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org<mailto:users-unsubscr...@tomcat.apache.org> For additional commands, e-mail: users-h...@tomcat.apache.org<mailto:users-h...@tomcat.apache.org>