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

7

17

I'm using Tomcat 7 on Eclipse Juno. I use workspace metadata as server location (Please see my tomcat configurations below).

Tomcat configurations

Also I got a Server project in eclipse [please see the image below] with separate server.xml and other configuration files.

Server project

Normally it works fine. The issue came across after I changed the server.xml (in eclipse project) for SSL configurations.

Configurations are working fine. But each time I run the project (Run-->Run on Server) server.xml get modified to the default version. My customized SSL changes are missing.

Also I tried to change server.xml in tomcat installation location (C:\apache-tomcat-7.0.35\conf), but it didn't pick from eclipse.

Can anyone please help me on this?

Thanks

Innards answered 5/3, 2013 at 20:16 Comment(0)
I
12

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

eclipse server panel

Innards answered 5/3, 2013 at 21:43 Comment(3)
Any alternative suggestions please…Innards
Check out my answer for an alternative solution.Admission
I suggest the solution offered by Exocom! Thanks.Rowlock
A
16

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)

Admission answered 11/1, 2016 at 14:59 Comment(0)
I
12

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

eclipse server panel

Innards answered 5/3, 2013 at 21:43 Comment(3)
Any alternative suggestions please…Innards
Check out my answer for an alternative solution.Admission
I suggest the solution offered by Exocom! Thanks.Rowlock
P
3

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.

enter image description here

Petronia answered 29/8, 2016 at 14:11 Comment(0)
A
0

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).

Acrimony answered 7/2, 2014 at 15:36 Comment(0)
U
0

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

Ugric answered 16/11, 2017 at 14:58 Comment(0)
C
0

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.

Craigie answered 24/6, 2019 at 19:27 Comment(0)
F
-1

Clean Tomcat Work Directory & Republish the project.

enter image description here

Forland answered 16/10, 2015 at 13:39 Comment(1)
Could you please elaborate more your answer adding a little more description about the solution you provide?Statutory

© 2022 - 2024 — McMap. All rights reserved.