Re: Tomcat deploying war file for every restart on Red Hat Linux 8.6

2024-08-02 Thread James H. H. Lampert

On 8/2/24 2:30 AM, Channa Puchakayala wrote:

Issue : Apache Tomcat deploying war file for every restart on Red Hat Linux
8.6 even though there are no changes in war file.


Look in your conf/server.xml file. Scroll down to the "

If you need to suppress redeployment of WAR files, you need to change it to



I speak from experience: in order to function, our webapp requires its 
configuration files to be customized for *every* installation, and with 
the default of autoDeploy="true", those customizations get overwritten 
every time Tomcat is launched, rendering the webapp completely afunctional.


Honestly, I've never understood why the default is the way it is.

Of course, if you've already set autoDeploy to false, and it's still 
redeploying with every Tomcat start, then the problem is something else.


--
James H. H. Lampert
Touchtone Corporation

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



Re: Tomcat deploying war file for every restart on Red Hat Linux 8.6

2024-08-02 Thread Sebastian Trost

James,

On 02.08.2024 17:25, James H. H. Lampert wrote:


If you need to suppress redeployment of WAR files, you need to change 
it to


    


That is true. However, Channa is reporting, that the war-tracker file 
doesn't get the same modified date as the war file. This shouldn't 
happen, since the war-tracker file gets created by Tomcat after 
deployment of an app and it will get the same modified date as the war 
file.


I speak from experience: in order to function, our webapp requires its 
configuration files to be customized for *every* installation, and 
with the default of autoDeploy="true", those customizations get 
overwritten every time Tomcat is launched, rendering the webapp 
completely afunctional.


I also speak from experience: My apps don't assume the app directory to 
be persistent. All the configuration is in the database/environment 
variables/other directories. That way, an application (or even tomcat) 
can easily be updated - just redeploy the new war file.


Sebastian


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



Re: Tomcat deploying war file for every restart on Red Hat Linux 8.6

2024-08-02 Thread Christopher Schultz

Channa,

On 8/2/24 05:30, Channa Puchakayala wrote:

Hi Tomcat Team,

Issue : Apache Tomcat deploying war file for every restart on Red Hat 
Linux 8.6 even though there are no changes in war file.


Observations:

-war-tracker file timestamp is setting with tomcat restart time which is 
not matched with original war file timestamp, so tomcat deleting 
existing ca-nim-sm folder and extracting war again for every restart.


-Tomcat log message is below

=

Line 13640: 2024-07-26 06:41:46,035 [main] INFO 
  org.apache.catalina.startup.ExpandWar - An expanded directory 
[/usr/Spectrum/tomcat/webapps/*ca-nim-sm*] was found with a last 
modified time that did not match the associated WAR. It will be deleted.




-server.xml setting (  unpackWARs="true" autoDeploy="false">)


-We observed this for multiple web applications (wars) on multiple 
systems, so it is not an issue single web application(war)


-Issue observed in Red Hat Linux 8.6, but same not occurring on windows 
box and Red Hat Linux 8.8, 8.9 and 8.10


Please notice *ca-nim-sm.war* file  time stamp

Please notice *war-tracker* file time stamp, which is set to tomcat 
restart time


Environment

Red Hat Linux 8.6

Java: OpenJDK 11.0.23 and 17.0.10

Tomcat :  9.0.87 and 9.0.91

Verified tomcat release notes and also tomcat defects in 
https://bz.apache.org/bugzilla/ , could 
not find any info/defect related to this.


Could you please help us,  why war-tracker file timestamp getting 
updated with tomcat restart time instead of keeping war file timestamp.


The code is fairly simple here in ExpandWar.java: the war-tracker file 
gets the last-modified date of the WAR file that was expanded, and 
shouldn't trigger a re-load after that unless either the WAR file or the 
war-tracker file's timestamps are modified.


Can you post the results of these commands?

$ stat /usr/Spectrum/tomcat/webapps/ca-nim-sm.war
$ stat /usr/Spectrum/tomcat/webapps/ca-nim-sm
$ stat /usr/Spectrum/tomcat/webapps/ca-nim-sm/META-INF/war-tracker

Please note that the log file shows the paths as being under 
/usr/Spectrum/tomcat/webapps/... while your screenshots show 
/usr/apache-tomcat-9.0.91/webapps/... are you sure you are looking in 
the right place(s) for these files and timestamps?


The next thing to do would be to add both timestamps to the log message 
to see what their values are. Perhaps revealing their values will give 
some insight into the root problem.


Are you able to compile your own Tomcat locally, or would you need a 
custom release artifact to try something like that?


-chris

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



Re: Issue with the log4j2.xml

2024-08-02 Thread Bill Stewart
On Fri, Aug 2, 2024 at 7:00 AM Burle, Saicharan wrote:

>  Can I get any update on this request? I have responded to the queries
asked, PFA email for the same.

That's not how this works.

https://devblogs.microsoft.com/oldnewthing/20080304-00/?p=23223

Bill