Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat inside Eclipse overwrites context fragments

Tags:

eclipse

tomcat

I have an Eclipse Project which is attached to a Tomcat 6 using WST. For testing reasons I need to set some context parameters to override settings in the web.xml. The following Server Options are set: "Serve without publishing" as I want to run my application right from the project and "Publish contexts to separate XML files".

Now I can find the context fragment inside .metadata.plugins\org.eclipse.wst.server.core\tmp1\Conf\catalina\localhost and change them as needed. This works for some time, but after each Eclipse restart my context fragment is replaced with a fresh generated one - without the required parameters of course.

How can I prevent Eclipse from replacing my configuration? Or is there a way to add the necessary parameters to the generated context fragment?

like image 366
Daniel Avatar asked Jul 13 '11 12:07

Daniel


1 Answers

Certainly changing stuff in the .metadata/.../wst.server is not a good idea - those directories are completely controlled by Eclipse.

If you look in your Eclipse 'Servers' project entry, you will see server.xml and context.xml - that is the place to change things. Eclipse copies those files to that .metadata directory - IF it isn't fouled up somehow.

like image 165
knunkler Avatar answered Oct 03 '22 04:10

knunkler