Eclipse modifies server.xml each time run the project (Run-->Run on Server)

强颜欢笑 提交于 2019-12-02 23:12:57
Exocom

In {workspace}/Servers you will find a folder for every Tomcat configuration, containing several configuration files, including the server.xml. There you then can edit the file directly.

To get changes taken into account restart Eclipse. That is imho better than removing and adding the configuration back all the time. Tested using Eclipse Mars and Tomcat 7.

(the solution is from: Eclipse with tomcat - eclipse modifies server.xml)

I found an applicable solution but not a perfect one.

What I have done is;

1.Changed server.xml file in installation location (In my case C:\apache-tomcat-7.0.35\conf)

2.Remove tomcat server from eclipse server panel (please see the image below)

3.Create a new server in eclipse server panel.

4.Then Server project will be generated new server.xml with my customized changes.

5.The trick is, initially eclipse picks server.xml from installation location when create a new server in panel.

Thanks

Make sure you are editing the files right beneath the tomcat server folder, not the ones beneath the config folder. Check the attached screenshot for the files I'm referring to.

I had this problem too, and the solution worked (I don't have enough reputation points to vote up the answer).

On a similar note, I had to make configuration changes to a port number and that also required me to delete and re-add my tomcat instance from STS (spring tool suite).

On Eclipse, double click on Server to view properties.
check "publish module contexts to separate XML files", and save it. Run Tomcat server. Eclipse will be create conf/[enginename]/[hostname]/[appname].xml without touching server.xml

Make sure that the path in the server.xml is same as in the Web project Settings.

To see the Web Project Settings: Right click on the project >> Properties >> Web Project Settings.

Always give the project path over here. The path in server.xml will automatically updated.

Subhashish

Clean Tomcat Work Directory & Republish the project.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!