简体   繁体   English

Eclipse中的Tomcat添加后重置配置文件

[英]Tomcat in Eclipse resets configuration files after adding

I am using Tomcat 6.x and Eclipse J2EE Kepler. 我正在使用Tomcat 6.x和Eclipse J2EE Kepler。 For reasons mentioned in my other question , I sometimes need to delete the Tomcat from the Servers list and re-add it. 由于另一个问题中提到的原因,有时我需要从“服务器”列表中删除Tomcat,然后重新添加它。 在此处输入图片说明

The weird thing is: after I re-add the server, two configuration files server.xml and context.xml revert to a previous state! 奇怪的是:重新添加服务器后,两个配置文件server.xmlcontext.xml恢复到先前的状态! let's call it S . 我们称它为S。 I cannot really tell what S is - it definitely is a state I once had, but it lacks some newer changes. 我不能真正说出S是什么-绝对是我曾经拥有的状态,但是它缺少一些新的更改。 For this reason my webapp does not work and I have to revert these two files in the workspace/Servers folder. 因此,我的webapp无法正常工作,我必须还原workspace/Servers文件夹中的这两个文件。

I'd love to fix this by updating S . 我很乐意通过更新S来解决此问题。 However, I am unable to find the source of S , where Eclipse takes it from - I tried fulltext-searching my computer for files that look like the server.xml and context.xml , but to no avail. 但是,我找不到S的来源,Eclipse从中获取S的来源-我尝试对计算机进行全文搜索,以查找类似于server.xmlcontext.xml ,但无济于事。 Specifically, I updated these two files in the conf/ folder of my Tomcat installation, but it did not help. 具体来说,我在Tomcat安装的conf/文件夹中更新了这两个文件,但没有帮助。

Where could Eclipse be keeping S ? Eclipse可以将S保留在哪里? In some weird DB in the workspace metadata? 在工作区中一些奇怪的数据库元数据? Could it be using the local history?... 可以使用当地历史吗?...

Thanks for any insights! 感谢您的任何见解!

If you are working on Eclipse then there should be a folder called Servers in your workspace. 如果您正在使用Eclipse,则工作区中应该有一个名为Servers的文件夹。 When you start your server for the first time, it copies over the tomcat conf files into this eclipse project. 首次启动服务器时,它会将tomcat conf文件复制到该eclipse项目中。 So no matter if you change your actual context.xml from outside, eclipse will override it with what is stored in the 'Servers' folder. 因此,无论您是否从外部更改实际的context.xml,eclipse都将使用存储在“ Servers”文件夹中的内容覆盖它。

If you still need the eclipse to take control of your tomcat installation directory, you need to primarily update this file from within the eclipse. 如果仍然需要使用eclipse来控制tomcat的安装目录,则首先需要从eclipse中更新此文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM