Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320687 - Updated server config files do not auto deploy when server is restarted
Summary: Updated server config files do not auto deploy when server is restarted
Status: RESOLVED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: jst.server (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.4   Edit
Assignee: Larry Isaacs CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard:
Keywords:
: 312335 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-22 22:41 EDT by Luke Pacholski CLA
Modified: 2017-10-11 16:36 EDT (History)
2 users (show)

See Also:
arvera: review+


Attachments
Patch to add a resource listener for Tomcat configuration changes (8.75 KB, patch)
2011-04-07 12:27 EDT, Larry Isaacs CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Pacholski CLA 2010-07-22 22:41:51 EDT
Overview:
In Eclipse 3.6/WTP 3.2.0, updating server config files (server.xml, tomcat-users.xml, etc) does not cause them to be republished the next time the server is restarted. One must manually publish, or restart Eclipse. I don't know what the behavior was in 3.3-3.5, but in Eclipse 3.2 this worked as expected. This is an issue with Tomcat 5.5 and 6.0; I'm assuming it would be an issue with other servers/versions as well, but have not verified.

Steps to Reproduce:
1) Create a new Tomcat server instance. No projects need to be associated with the server (although one or more can be). "Automatically publish when resources change" should be selected (it is by default).
2) Start the server to verify it works (default port is 8080).
3) Stop the server. Change the server port in server.xml to 8181. Save.
4) Start the server.

Actual Results:
server.xml will not have published, and the server will start up on the original port, 8080. Eventually WTP will time out because it can't connect to the server on the new port, 8181.

Expected Results:
server.xml should publish to the server, changing the port to 8181.

Manually publishing will propagate the updated server.xml to Tomcat.

Build Date & Platform:
Version: Helios Release
Build id: 20100617-1415
Win XP SP3

Additional Builds and Platforms:
This also occurs with WTP M-3.2.1-20100716070539.
Does not happen (works correctly) with Eclipse 3.2.

Additional Information:
It looks like editing the port in the Overview screen (by double clicking on the server in the Servers view) does force server.xml to publish when restarting the server. At least it does on my home PC. I will verify the behavior on my work PC.

I have verified that this occurs with both existing workspaces (upgraded from Eclipse 3.2 and 3.4) and a fresh workspace.

The server location (Use workspace metadata/Use Tomcat installation) does not seem to make a difference.
Comment 1 Luke Pacholski CLA 2010-07-23 09:05:07 EDT
"It looks like editing the port in the Overview screen (by double clicking on
the server in the Servers view) does force server.xml to publish when
restarting the server. At least it does on my home PC. I will verify the
behavior on my work PC."

Confirmed on work PC, using WTP M-3.2.1-20100716070539.
Comment 2 Luke Pacholski CLA 2010-08-04 19:47:21 EDT
Continues to be an issue in WTP 3.2.1 final (3.2.1.v201007151559-377A88s73533F5H384A).
Comment 3 Luke Pacholski CLA 2010-10-20 23:15:21 EDT
Continues to be an issue in WTP 3.2.2 final (as installed with Eclipse 3.6 SR1).

Also continues to be an issue in WTP 3.3.0M2 (installed on top of 3.6 SR1).
Comment 4 Luke Pacholski CLA 2010-10-26 23:00:14 EDT
Is anybody looking into this? Should I have assigned it to a different group?
Comment 5 Larry Isaacs CLA 2010-10-27 09:32:34 EDT
Sorry, my initial scan of this bug a while back may have been too quick and I misinterpreted this as the known issue where modifying the server configuration files won't cause a restart to be requested.  I've confirmed the behavior.  I'll try to get this fixed in 3.2.3.  For now, it appears right-clicking on the server in the Server's view and selecting "Clean..." will force the configuration changes to be published.
Comment 6 Luke Pacholski CLA 2010-10-31 21:03:44 EDT
Awesome, thanks. Like I said, manually publishing is also a workaround.
Comment 7 Larry Isaacs CLA 2011-02-16 14:52:03 EST
*** Bug 312335 has been marked as a duplicate of this bug. ***
Comment 8 Larry Isaacs CLA 2011-04-07 12:27:45 EDT
Created attachment 192762 [details]
Patch to add a resource listener for Tomcat configuration changes
Comment 9 Larry Isaacs CLA 2011-04-07 12:43:29 EDT
Hi Angel,

I'm requesting this review for deciding the _possible_ inclusion of this patch in WTP 3.2.4.  I'm fine either way.  The issue can be annoying and is technically a regression, but it's not a problem that occurs that often and has a simple workaround.  The code is fairly straightforward, so I think it could be a candidate for WTP 3.2.4.  Sorry for not finding cycles sooner.

Note that this patch contains a small addition to the serverListener in ServersView2.java.  This is needed so that when a Tomcat server state is marked as needing to publish, the Servers view will refresh.  Currently, it appears the Servers view is refreshed only if the server changes its running state, but not it's publish state.  Publish state changes only refreshed the view for modules.

Thanks,
Larry
Comment 10 Larry Isaacs CLA 2011-04-14 10:26:05 EDT
Changes have been committed to 3.2.x maintenance and HEAD, and are present in latest WTP 3.2.4 and 3.3 builds.
Comment 11 Eclipse Genie CLA 2017-10-11 16:36:08 EDT
New Gerrit change created: https://git.eclipse.org/r/109032