Tomcat
1 前言
一个问题,一篇文章,一出故事。
笔者今天遇到访问Tomcat服务遇到服务自动停止事宜,Tomcat日志有如下警告,
29-Aug-2022 09:23:18.505 WARNING [localhost-startStop-1] org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context} Setting property 'antiJARLocking' to 'true' did not find a matching property.
2 最佳实践
2.1 寻找异常的配置文件
cd /usr/tomcat/apache-tomcat-8.5.81 grep -R 'antiJARLocking="true"'
可以搜索到如下配置文件已经配置’antiJARLocking=”true”‘,
webapps/project01/META-INF/context.xml:<Context antiJARLocking="true" path="/project01"/> webapps/project02/META-INF/context.xml:<Context antiJARLocking="true" path="/project02"/> webapps/project03/META-INF/context.xml:<Context antiJARLocking="true" path="/project03"/>
2.2 修复方法
cd /usr/tomcat/apache-tomcat-8.5.81 vim webapps/project01/META-INF/context.xml
配置按如下范例修改,
<?xml version="1.0" encoding="UTF-8"?> <Context antiJARLocking="false" path="project01"/>
参阅文档
=================
https://bz.apache.org/netbeans/show_bug.cgi?id=253552
https://stackoverflow.com/questions/11607009/what-is-antijarlocking-attribute
没有评论