Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312335 - multiple instances of tomcat - synchronization of config files
Summary: multiple instances of tomcat - synchronization of config files
Status: CLOSED DUPLICATE of bug 320687
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Larry Isaacs CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-10 16:46 EDT by vychtrle CLA
Modified: 2011-02-16 14:52 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vychtrle CLA 2010-05-10 16:46:43 EDT
Build Identifier: 20100218-1602

I'm wondering how is eclipse bootstrapping catalina, please take a look at the steps.

Reproducible: Always

Steps to Reproduce:
1.created a server in WTP and pick "Use the custom location" option in the server configuration in eclipse
2.New configuration files are created in workspace/Server/server-name-config/
3.Set up the server path and deploy path for my catalina base (not the internal .metadata one, but custom)
4.After I started it, the new default configuration files overwrote the original CATALINA_BASE/conf files I had there - I was glad, it should be like this (even though it should be the other way around at this starting point but I was glad because of the synchronization)
5. then if I change CATALINA_BASE/conf/server.xml  and restart the server from eclipse, it is not synchronized anymore, CATALINA_BASE/conf/server.xml stays modified
6.also after I made changes in the eclipse config file workspace/Server/server-name-config/server.xml and restarted the server, the changes didn't appeared in the original file in CATALINA_BASE/conf/server.xml
7.So I set the CATALINA_BASE/conf/server.xml to fault configuration and restarted tomcat from eclipse and it worked ! it took the configuration from /Server/server-name-config/server.xml
8.Then I deleted CATALINA_BASE/conf/server.xml and it said that there is no server.xml in catalina base !
Is there some sort of caching or I don't understand. How is it possible ?
Comment 1 Larry Isaacs CLA 2011-02-16 14:52:03 EST
The source of the problem is that I failed to notice an important behavioral change in server publishing in 3.2.x.  In prior versions of WTP, a publish operation would always publish the "server" portion of the operation, regardless of whether changes had or had not occurred in the server's configuration files, e.g. server.xml, tomcat-users.xml, etc.  In WTP 3.2.x and later, nothing happens in a publish operation if the server isn't marked as "dirty".

Since there had not been a need to mark the server "dirty" for configuration changes, there is no resource listener trying to detect changes to the Tomcat configuration files.  As a result, publish operations won't publish configuration changes unless some other change has marked the server as "dirty".  Implementing a resource listener to do this has to be done carefully so as not to impact performance too much.  Thus, it might be too big a change for WTP 3.2.x.  I'll have to see once I find time to implement this for WTP 3.3.

In the mean time, as noted in Bug 320687, manually forcing a full publish operation by right-clicking on the Tomcat server in the Servers view and selecting "Clean..." should synchronize the configuration files whenever changes are made.

*** This bug has been marked as a duplicate of bug 320687 ***