8

I use tomcat with eclipse in 'Use tomcat installation' mode. My problem is, that eclipse overwrites tomcats server.xml every time, and deletes my crossContext="true" elements.

Should I use custom location? Or the eclipse setup is wrong?

Thanks!

jmj
  • 237,923
  • 42
  • 401
  • 438
Anvar
  • 404
  • 2
  • 9
  • 19

3 Answers3

25

You can edit the equivalent configuration files inside your "Server" project/folder in the eclipse workspace. Those are the configuration files with which eclipse is overwriting the ones found under your Tomcat installation.

JPS
  • 526
  • 7
  • 19
  • This worked for me. Not sure I understand what the logic is behind not updating from the server.xml in the Tomcat installation I configured as my existing Tomcat installation. – k-den Jun 11 '13 at 15:22
  • I believe it may be because in this way you may have a different configuration for the apps you deploy from within Eclipse, and those that you deploy directly on Tomcat. – JPS Dec 30 '13 at 22:24
  • Can you explain a little more precise where I can find the equivalent configuration files inside the Eclipse project? Would ge great, thanks! – lukasziegler Oct 16 '14 at 13:00
  • @lukasziegler inside Eclipse Project Explorer you should see a Servers folder, inside that Servers folder there will be a Tomcat folder and it's related config files that you can modify – Ghos3t Feb 15 '21 at 16:06
1

I have experienced a lot of pain getting Eclipse to interact nicely with Tomcat. I recently switched over to Jetty and I will never go back! It's especially easy to use if you use Maven as your build manager. If you use Jetty for development, you can still use Tomcat for deployment.

schmmd
  • 18,650
  • 16
  • 58
  • 102
1

If you want to preserve Tomcat artifacts then you can choose "Use Workspace Metadata" option. This option will copy all configuration files to "{workspace}/.metadata/.plugins/org.eclipse.wst.server.core" directory but still use the installed Tomcat Binaries for starting and stopping server. This is a neat way to have multiple server configs using a single tomcat.

Vineet
  • 11
  • 1
  • I switched from "Use Workspace Metadata" mode to 'Use tomcat installation' mode, because I want to use eclipse's internal web browser to test my app. If I choose "Use Workspace Metadata" mode, I can't tell the crossContexting to eclipse's tomcat config... – Anvar Apr 04 '11 at 20:12