Tomcat 工作目录必须定期清除 [英] Tomcat work directory has to be cleared periodically

查看:32
本文介绍了Tomcat 工作目录必须定期清除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的 Tomcat 出现了一个问题,我的同事都无法真正解释这个问题.我们在 Linux 计算机上有一个 tomcat (版本 7.0.26).部署是通过爆炸式战争完成的 - 我们的类被打包成 jar,其余的直接进入 WEB-INF 和 META-INF).

we got a problem with our Tomcat that non of my colleagues can really explain. We have a tomcat (version 7.0.26) on a linux computer. The deployment is done with an exploded war - our classes are jar packaged, the rest goes directly into WEB-INF and META-INF).

此外,还有一个 CMS 服务器,用于生成 JSP 文件,这些文件定期部署到 tomcat Web 应用程序中.

Plus there is a CMS server that generates JSP files wich are deployed periodically into the tomcat web app.

经过一段时间的热交换、创建和删除 JSP 文件后,tomcat 做了一些奇怪的事情.随机给出 404 错误或发布旧版本,有时是最新版本等等.

After some time of hot swapping, creating and deleting JSP files, the tomcat does some weird stuff. Randomly giving out 404 errors or publishing old versions, sometimes the latest versions and so on.

要解决这个问题,我们必须不时清除 $CATALINA_HOME/work.tomcat 在开发模式下运行,这意味着它经常查找 JSP 文件修改,afaik.但这在这里似乎不太好用.删除工作目录后,一切正常,立即.

To solve that, we have to clear the $CATALINA_HOME/work from time to time. The tomcat runs in development mode, which means it looks for JSP file modifications frequently, afaik. But that doesn't seem to work pretty well here. After deleting the work directory, everything if fine, immediately.

有谁知道,如何摆脱这种行为?是否需要设置任何标志来避免这种情况发生?

Does anyone know, how to get rid of this behavior? Are there any flags that need to be set to avoid that thing to happen?

推荐答案

仅供参考-servlet-with-java-lang-noclassdeffounderror">带有 java.lang.NoClassDefFoundError 的 servlet 严重异常

FYI I had the same problem, posted my answer here Severe exception on servlet with java.lang.NoClassDefFoundError

在您的情况下,只需编写一个脚本,在每次热交换新文件时删除工作目录.在 tomcat 配置参考中,它写成黑底白字 tomcat8 配置参考

In your case just write a script that removes the work directory every time you hot swap new files. In the tomcat configuration reference it's written black on white tomcat8 configuration reference

这篇关于Tomcat 工作目录必须定期清除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆