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

Unknown
  • 863
  • 2
  • 14
  • 29

7 Answers7

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)

Community
  • 1
  • 1
Exocom
  • 791
  • 2
  • 8
  • 24
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

Unknown
  • 863
  • 2
  • 14
  • 29
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

Muhammad Gelbana
  • 3,890
  • 3
  • 43
  • 81
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).

Pigasus
  • 130
  • 1
  • 2
  • 10
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

m4d0
  • 1
  • 1
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.

Kabiraj Kharel
  • 203
  • 2
  • 11
-1

Clean Tomcat Work Directory & Republish the project.

enter image description here

spenibus
  • 4,339
  • 11
  • 26
  • 35
  • Could you please elaborate more your answer adding a little more description about the solution you provide? – abarisone Oct 16 '15 at 13:47