Tomcat里antiResourceLocking的作用和引起的一个问题

tomcat antiResourceLocking antiJARLocking 的作用和用法 我们先来看看这个 antiResourceLocking 到底是干什么的! If true, Tomcat will prevent any file locking. This will significantly impact startup time of applications, but allows full webapp hot deploy and undeploy on platforms or configurations where file locking can occur. If not specified, the default value is false. 立即下载

今天在论坛看到了一个网友的提问:

奇怪的问题,文件上传到Tomcat下的temp目录里面了


虽然我肯定是配置的问题,不过我还真的没有自己遇到这个。

不过还好,楼主真的在配置文件里找到了问题,那就是 antiResourceLocking


我们先来看看这个 antiResourceLocking 到底是干什么的!

If true, Tomcat will prevent any file locking. This will significantly impact startup time of applications, but allows full webapp hot deploy and undeploy on platforms or configurations where file locking can occur. If not specified, the default value is false .

Please note that setting this to true has some side effects, including the disabling of JSP reloading in a running server: see Bugzilla 37668 .

Please note that setting this flag to true in applications that are outside the appBase for the Host (the webapps directory by default) will cause the application to be deleted on Tomcat shutdown. You probably don't want to do this, so think twice before setting antiResourceLocking=true on a webapp that's outside the appBase for its Host.


我大致翻译一下:

如果这个参数为true,那么将组织任何文件锁。这将明显的影响应用的启动时间,但允许webapps,可能发生锁的平台和配置下,支持完整的热部署和热卸载。如果不配置,默认值是false;

如果设置为true,有一些副作用,包括屏蔽了JSP文件在运行服务器上的重新加载。

如果设置为true,且部署在Host的AppBase目录外面(默认是webapps),在Tomcat关闭的时候将导致应用被删除。


最主要的就翻译到这里了。实际上,如果为false,因为存在锁,在你重新发布的时候,可能出现部分代码无法更新。因为原始文件可能因为被锁住了,不能删除。


当然,如果为false,那么部署的目录就是和包名相同了。如果是false,则会每次都放到一个临时目录下面,一个temp目录。这也是这个配置引发的一个副作用。


另外的一个类似的配置 antiJARLocking 是防止jar类库被锁定而无法删除这个作用的。


每天努力工作,每天都有收获。早上的经验继续有用,我先复制一份先。呵呵呵!

 

今天是个好日子,因为明天就是周末了,希望我能回天津,顺便祝大家周末好心情。

Diebold-Mariano检验 给定两个预测的预测结果,我们希望比较他们的预测结果,以用于预测模型精度的比较。 Diebold-Mariano检验本质是一个t检验,用于检验替代预测的两个损失序列的平均值是否相等。即,它是一系列损失差的零均值的t检验。在存在自相关的情况下,它使用损失差分时间序列标准差的自相关一致性估计。 注意,在使用DM检验式时,假设损失序列是平稳的。 另外,DM检验在小样本数据时往往会拒绝零假设。对于小样本数据,推荐Harvey, Leybourne and Newbold (HLN)检验【1】; 参考文献 【1】htt 阅读详情

相关推荐

等离子体密度诊断集

在实验上不仅要对带电粒子的分布和运动状态进行诊断,如电子温度、电子密度、电离温度等参数,还需要对等离子体中的中性粒子进行必要的实验测量,来获得有关物种的产生、能量分布以及各个激发态布居数分布等信息,如气体温度、转动温度、振动温度、激发温度等参数。

in546的博客 1354

myeclipse不能自动编译和发布问题

部署方式:通过myeclipse自动部署项目到tomcat的webapp文件夹下,不是通过修改tomcat的配置文件。 问题描述:修改.jsp、java等文件后,无法在浏览器中看到修改后的效果,需要重启tomcat,才可以看到。 原因:解压后的原context.xml文件中的context节点默认有两个属性:antiResourceLocking="true" antiJARLoc...

小格调 365

OpenCV机械臂手眼标定

这篇文章总结了手眼标定的原理,利用OpenCV自带的函数套用参数即可完成眼在手上和眼在手外两种标定。

Q先森的博客 6597

hudson + maven +svn 持续开发测试平台

  1.安装jdk2.安装maven3.安装tomcat4.把hudson.war  放到tomcat 发布程序目录下 5。登录hudson 地址:hppt://localhost:8080/hudson 6.首次登录会让下载需要的插件、svn的、deploy的等7.完成插件安装 配置hudson的系统设置,主要是jdk设置、maven设置8.新建任务,主要配置svn、deploy wa...

feiteyizu 262

视觉定位避坑指南:基于双mark点的坐标转换常见错误排查

本文详细解析了工业视觉项目中基于双mark点的坐标转换常见错误及排查方法,涵盖旋转矩阵构建、坐标系原点选择、图像预处理优化等关键环节。通过实战案例和代码示例,帮助工程师避免定位偏差,提升系统精度,特别适用于自动化检测和精密制造场景。

7z8x2c4v6b9的博客 168

斯坦福HumanPlus机器人核心技术解析:从HST强化学习框架到HIT模仿学习的实现路径

本文深入解析了斯坦福HumanPlus人形机器人的核心技术实现路径。其核心在于HST强化学习框架与HIT模仿学习架构的协同:HST作为“小脑”,通过rsl_rl框架在仿真中训练稳健的低级运动控制;HIT作为“大脑”,基于改进的Transformer架构学习高级任务规划。文章详细拆解了从算法原理、代码实现到硬件部署的全流程,为复现这一前沿机器人系统提供了实战指南。

weixin_29082143的博客 282

Tomcat中antiResourceLocking和antiJARLocking的作用

更新了某个webapp,把新的WAR包放到webapps目录下,Tomcat就会自动把原来的同名webapp删除,并把WAR包解压,运行新的 webapp。但是,有时候Tomcat并不能把旧的webapp完全删除,通常会留下WEB-INF/lib下的某个jar包,必须关闭Tomcat才能删除,这就导致自动部署失败。 解决方法是在元素中增加一个属性antiResourceLocking="true"

学无止境 7856

全局子程序 参数调用

为什么要子程序: 为了实现程序结构化,我们尽量使用不同功能的功能块来实现一些特定的功能, 子程序接口: 使用过程的注意事项,尤其是数组使用时的注意事项 从一个主程序中可以将参数传递到局部或全局子程序和函数中。 怎样传递参数有 2 种方式: 作为 IN 参数 变量值在主程序中保持不变。 这种传递方式也称为“ 值传递 (Call by Value)”。 作为 OUT 参数 子程序读取并更改该值,然后将新值写回到主程序中。 这种传递方式也称为“Call by Reference”。 举例说明 1 DEF MY

Eric_Yang1024的博客 1095

tomcat设置context不生效_tomcat-context.xml配置问题

我们先来看看这个antiResourceLocking到底是干什么的!If true, Tomcat will prevent any file locking. This will significantly impactstartup time of applications, but allows full webapp hot deploy and undeploy onplatforms...

weixin_34847099的博客 823

手把手带你搭建一个语音对话机器人:5分钟定制个人AI小助手

通过本文的简单步骤,你已经掌握了如何用 Python 搭建一个语音对话机器人。我们使用了实现语音识别,利用 OpenAI API 生成对话内容,并通过gTTS将文本转换为语音。整个流程非常简洁,你可以根据自己的需求进一步扩展机器人功能,甚至将其集成到实际的应用场景中。

小蜗牛的珍贵百宝箱 4806

嵌入式系统开发笔记96:将STM32CubeIDE设置为中文

本文介绍将STM32CubeIDE设置为中文的方法。

snmplink的博客 8538

tomcat防cc_浅析Tomcat防止资料被锁的方式

在Windows平台的Tomcat上部署应用后,应用下的个别文件可能会被Tomcat锁住,解部署的时候删除不掉那些内容,就会导致无法重部署。如果解部署删除不掉被锁的文件,Tomcat会在日志中警告说:2013-1-9 15:44:09 org.apache.catalina.startup.ExpandWar delete严重: [D:\tomcat\apache-tomcat-7.0.32\we...

weixin_39724748的博客 378

基于YOLOv10的建筑图纸物体检测系统:从数据集构建到UI界面实现

高度结构化的图形元素标准化的符号和标注系统多层次的细节表达精确的尺寸和位置关系。

YOLO 390

Tomcat里antiResourceLocking的作用和引起的一个问题 .

今天在论坛看到了一个网友的提问: 奇怪的问题,文件上传到Tomcat下的temp目录里面了 虽然我肯定是配置的问题,不过我还真的没有自己遇到这个。 不过还好,楼主真的在配置文件里找到了问题,那就是 antiResourceLocking 我们先来看看这个 antiResourceLocking 到底是干什么的! If true, Tomcat will pr

huchunlinnk的专栏 773

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

Tomcat中antiResourceLocking、antiJARLocking说明

Tomcat应用更新时,把新的WAR包放到webapps目录下,Tomcat就会自动把原来的同名webapp删除,并把WAR包解压,运行新的 webapp。 但是,有时候Tomcat并不能把旧的webapp完全删除,通常会留下WEB-INF/lib下的某个jar包,必须关闭Tomcat才能删除,这就导致自动部署失败。 解决方法是在<Context>元素中增加一个属性antiRes...

lu1213136330的博客 571

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jenkins+maven+tomcat热部署问题

用jenkins+maven自动部署项目到tomcat,在Undeploying 的时候报错。主要原因是tomcat会将个别文件锁住(被锁的文件通常是/WEB-INF/lib下的Jar包),解部署的时候删除不掉那些内容,就会导致无法重部署。。 解决方案:在context.xml的Context元素上设置antiResourceLocking属性为true 解决方案是参考网上的一个文章(

du_bu的专栏 3284

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

linux 下用tomcat部署web項目 上傳圖片访问404问题

感觉现在网上查个问题找答案真难,记录这个问题希望能帮助各位小白。 问题解决了,首先说一下,我这个项目是拿来维护的,所以不想大改和重构,我先说一下我这个问题的现象,我把项目根路径下的所有图片全部都移动到了/usr/local/uploadfiles目录下,而项目在/usr/local/tomcat/webapps/myproject里,所以我是通过tomcat的虚拟路径来映射图片的访问的。然后发现上

shenhaichao1205的博客 2649

Tomcat项目部署和启动

一、静态部署 1、直接将web项目文件件拷贝到webapps 目录中      Tomcat的Webapps目录是Tomcat默认的应用目录,当服务器启动时,会加载所有这个目录下的应用。所以可以将JSP程序打包成一个 war包放在目录下,服务器会自动解开这个war包,并在这个目录下生成一个同名的文件夹。一个war包就是有特性格式的jar包,它是将一个web程序的所有内容进行压缩得到。具体如

qq_38449792的博客 1357

浅析Tomcat防止文件被锁的方式

在Windows平台的Tomcat上部署应用后,应用下的个别文件可能会被Tomcat锁住,解部署的时候删除不掉那些内容,就会导致无法重部署。如果解部署删除不掉被锁的文件,Tomcat会在日志中警告说: 2013-1-9 15:44:09 org.apache.catalina.startup.ExpandWar delete严重: [D:\tomcat\apache-tomcat-7.0.3...

知之 790

Tomcat配置context.xml问题

关于Tomcat的配置文件问题,请参考Apache Tomcat官网Document菜单,根据版本号选择恰当的Reference。 我使用的环境:netbeans 内嵌 Tomcat 8.0 (1) 标签内配置的参数antiResourceLocking和reloadable antiResourceLocking 官网原文: If true, Tomcat will prevent a

BeALittleCat的专栏 1277

Tomcat 源码解析一容器加载-大寂灭指(中)

tomcat StandardContext启动

黄裳博客 1228

windows下tomcat无法完全undeploy的问题

        最近在写struts2应用的时候。发现deploy到tomcat的应用经常无法完全undeploy,必须restart tomcat后才能完全undeploy。 应该是一些jar资源被锁定。要解决这个问题。只要在web/META-INF下建立一个context.xml文件。 xml version="1.0" encoding="UTF-8"?>Context relo

Kxllen 2093

tomcat上传文件问题

问题:解压版的tomcat6.0 上传文件附件 都在 tomcat下的temp目录下。 解决:将tomcat下的apache-tomcat-6.0.20\conf下的context.xml文件 中antiResourceLocking改为false

赵艳芳 206
上一篇: 经验从哪里来?从痛苦中来!
下一篇: 大家是如何释放工作压力的方法总结
老紫竹
博客等级 码龄19年 1万+粉丝 1252原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值