Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342505

Summary: Tomcat 6 Server "Publish module contexts to separate XML files" fails with '/' in context root
Product: [WebTools] WTP ServerTools Reporter: Mike Youngstrom <youngm>
Component: wst.serverAssignee: Larry Isaacs <larryisaacs>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P3 CC: youngm
Version: 3.2   
Target Milestone: 3.3   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/109034
Whiteboard:

Description Mike Youngstrom CLA 2011-04-11 22:29:43 EDT
Tomcat 6 Server setting "Publish module contexts to separate XML files" silently fails when there is a '/' in the context root.  It appears to just automatically fall back to using the server.xml.

Steps to reproduce:

1. Create a Tomcat 6 Server
2. Open server properties page and check "Publish module contexts..." box.
3. Create a new Dyamic Web Project
4. Right click->Properties->Web Project Settings
5. Set the Context root: to something with a '/' like "test/dude".
6. Deploy the dynamic web project to the server.
7. Examine the server.xml in the workspace's metadata directory: ".metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\server.xml"
8. Note the <Context/> element in the server.xml.
9. Note the lack of an xml file in conf/Catalina/localhost

Handling a '/' in a Tomcat context root is a little tricky.  The key is that you need to name the .war file or in this case the context.xml file correctly replacing all '/' with '#'.

Mike
Comment 1 Mike Youngstrom CLA 2011-04-11 23:11:01 EDT
FYI, I tested it with Indigo M6a and Tomcat 7.  Same behavior.  This issue may be higher priority with Tomcat 7 given this discussion I found:

http://www.eclipse.org/forums/index.php?&t=msg&goto=546672
Comment 2 Larry Isaacs CLA 2011-04-21 13:33:00 EDT
This has been fixed at HEAD and is present in the current WTP 3.3.0 build.
Comment 3 Eclipse Genie CLA 2017-10-11 16:36:06 EDT
New Gerrit change created: https://git.eclipse.org/r/109034