You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Mcalexander, Jon J." <jo...@wellsfargo.com.INVALID> on 2024/11/07 18:08:24 UTC

Tomcat Service(s) on Windows, Procmon question

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.

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.

Thank you kindly!

Dream * Excel * Explore * Inspire
Jon McAlexander | Senior Infrastructure Engineer | Middleware/App Hosting | FHP | CTO | Wells Fargo Technology
8080 Cobblestone Rd | Urbandale, IA 50322 MAC: F4469-010  | +1 515 988 2508 | jonmcalexander@gmail.com<ma...@gmail.com>
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.


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

Posted by "Mcalexander, Jon J." <jo...@wellsfargo.com.INVALID>.
From: david w <da...@gmail.com>
Sent: Thursday, November 7, 2024 2:09 PM
To: Tomcat Users List <us...@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 <us...@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>>

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

To: users@tomcat.apache.org<ma...@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-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>>



For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>>





[Mcalexander, Jon J.]

Thanks David, will test that out!

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

Posted by david w <da...@gmail.com>.


________________________________
Sent: Thursday, November 7, 2024 8:53 PM
To: Tomcat Users List <us...@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>
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.



-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-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>

For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>



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

Posted by "Mcalexander, Jon J." <jo...@wellsfargo.com.INVALID>.
Thanks, we aren’t allowed to until you guys fully release. 😊

From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Thursday, November 7, 2024 4:54 PM
To: users@tomcat.apache.org
Subject: Re: Tomcat Service(s) on Windows, Procmon question

Jon, On 11/7/24 17: 37, Mcalexander, Jon J. wrote: > Thank you. ☹ You could grab the just-rolled 9. 0. 97. It's already got 2 +1 votes. -chris > From: Christopher Schultz <chris@ christopherschultz. net> > Sent: Thursday, November


Jon,



On 11/7/24 17:37, Mcalexander, Jon J. wrote:

> Thank you. ☹



You could grab the just-rolled 9.0.97.



It's already got 2 +1 votes.



-chris



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

> Sent: Thursday, November 7, 2024 4:16 PM

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

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

>

> Jon, On 11/7/24 14: 53, Mcalexander, Jon J. wrote: > Sorry to top-reply, but does this regression exist in 10. 1. 31 as well, or only 9. 0. 96? It's all of the October releases :/ -chris > From: Christopher Schultz <chris@ christopherschultz. net>

>

>

> Jon,

>

>

>

> On 11/7/24 14:53, Mcalexander, Jon J. wrote:

>

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

>

>

>

> It's all of the October releases :/

>

>

>

> -chris

>

>

>

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

>

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

>

>> To: users@tomcat.apache.org<ma...@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

>

>>

>

>>

>

>>

>

>>

>

>>

>

>> ---------------------------------------------------------------------

>

>>

>

>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>>>

>

>>

>

>> For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>>>

>

>>

>

>>

>

>>

>

>

>

>

>

> ---------------------------------------------------------------------

>

> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>>

>

> For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>>

>

>

>





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

To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>

For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>



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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jon,

On 11/7/24 17:37, Mcalexander, Jon J. wrote:
> Thank you. ☹

You could grab the just-rolled 9.0.97.

It's already got 2 +1 votes.

-chris

> From: Christopher Schultz <ch...@christopherschultz.net>
> Sent: Thursday, November 7, 2024 4:16 PM
> To: users@tomcat.apache.org
> Subject: Re: Tomcat Service(s) on Windows, Procmon question
> 
> Jon, On 11/7/24 14: 53, Mcalexander, Jon J. wrote: > Sorry to top-reply, but does this regression exist in 10. 1. 31 as well, or only 9. 0. 96? It's all of the October releases :/ -chris > From: Christopher Schultz <chris@ christopherschultz. net>
> 
> 
> Jon,
> 
> 
> 
> On 11/7/24 14:53, Mcalexander, Jon J. wrote:
> 
>> Sorry to top-reply, but does this regression exist in 10.1.31 as well, or only 9.0.96?
> 
> 
> 
> It's all of the October releases :/
> 
> 
> 
> -chris
> 
> 
> 
>> From: Christopher Schultz <ch...@christopherschultz.net>>
> 
>> Sent: Thursday, November 7, 2024 1:16 PM
> 
>> To: users@tomcat.apache.org<ma...@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
> 
>>
> 
>>
> 
>>
> 
>>
> 
>>
> 
>> ---------------------------------------------------------------------
> 
>>
> 
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>>
> 
>>
> 
>> For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>>
> 
>>
> 
>>
> 
>>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>
> 
> For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>
> 
> 
> 


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


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

Posted by "Mcalexander, Jon J." <jo...@wellsfargo.com.INVALID>.
Thank you. ☹

From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Thursday, November 7, 2024 4:16 PM
To: users@tomcat.apache.org
Subject: Re: Tomcat Service(s) on Windows, Procmon question

Jon, On 11/7/24 14: 53, Mcalexander, Jon J. wrote: > Sorry to top-reply, but does this regression exist in 10. 1. 31 as well, or only 9. 0. 96? It's all of the October releases :/ -chris > From: Christopher Schultz <chris@ christopherschultz. net>


Jon,



On 11/7/24 14:53, Mcalexander, Jon J. wrote:

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



It's all of the October releases :/



-chris



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

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

> To: users@tomcat.apache.org<ma...@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

>

>

>

>

>

> ---------------------------------------------------------------------

>

> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>>

>

> For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>>

>

>

>





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

To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>

For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>



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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jon,

On 11/7/24 14:53, Mcalexander, Jon J. wrote:
> Sorry to top-reply, but does this regression exist in 10.1.31 as well, or only 9.0.96?

It's all of the October releases :/

-chris

> 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.
> 
> 
> 
> -chris
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>
> 
> For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>
> 
> 
> 


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


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

Posted by "Mcalexander, Jon J." <jo...@wellsfargo.com.INVALID>.
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>
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.



-chris





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

To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>

For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>



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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Rob,

On 11/7/24 17:54, Rob Sargent wrote:
>>>
>>> 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?
>>
>> I honestly have no idea. I think if you have a script-as-a-service, it 
>> will run and then just finish.
>>
>> -chris
>>
> 
> Does it matter much that the service is "running" but doing nothing 
> after having cleaned up?

Again, I have no idea. I don't admin Windows, these are just educated 
guesses given my limited experience.

-chris


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


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

Posted by Rob Sargent <rs...@xmission.com>.
>>
>> 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?
>
> I honestly have no idea. I think if you have a script-as-a-service, it 
> will run and then just finish.
>
> -chris
>

Does it matter much that the service is "running" but doing nothing 
after having cleaned up?



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


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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jon,

On 11/7/24 14:29, Mcalexander, Jon J. wrote:
> 
> 
> 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?

I honestly have no idea. I think if you have a script-as-a-service, it 
will run and then just finish.

-chris


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


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

Posted by "Mcalexander, Jon J." <jo...@wellsfargo.com.INVALID>.

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-unsubscribe@tomcat.apache.org<ma...@tomcat.apache.org>

For additional commands, e-mail: users-help@tomcat.apache.org<ma...@tomcat.apache.org>



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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
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


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