Bug 44879 - Deploying WAR overwrites context fragment
Summary: Deploying WAR overwrites context fragment
Status: RESOLVED WORKSFORME
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.25
Hardware: All Mac OS X 10.4
: P2 minor (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-25 17:35 UTC by Zhihong Zhang
Modified: 2008-05-08 08:17 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhihong Zhang 2008-04-25 17:35:42 UTC
When a war is deployed in webapps directory, Tomcat 5 overwrites any context xml in conf/engine/host directory with the one in META-INF in the war.

This behavior is undesirable. We normally put a customized context fragment to overwrite what's delivered in WAR. Can this behavior be modified so the context fragment in host directory is kept intact if its docBase points to the same war?

Thanks!

Zhihong
Comment 1 Mark Thomas 2008-04-27 08:48:49 UTC
The behaviour you describe is not the intended behaviour. I have checked the code and performed my own test and cannot repeat this problem.

If you still see this issue please provide the smallest, simplest series of steps to reproduce this issue with a clean install of the latest stable 5.5.x release.
Comment 2 Zhihong Zhang 2008-04-27 14:39:53 UTC
(In reply to comment #1)
> The behaviour you describe is not the intended behaviour. I have checked the
> code and performed my own test and cannot repeat this problem.
> 
> If you still see this issue please provide the smallest, simplest series of
> steps to reproduce this issue with a clean install of the latest stable 5.5.x
> release.
> 

Mark,

Than you for looking into this issue. You are right. I couldn't reproduce this problem on a straight startup either. But I know this happens because my context file got overwritten several times and our QA reported the same issue. It probably has something to do with redeploying the app.

I will try to find the exact steps to reproduce and let you know.

Zhihong
Comment 3 Mark Thomas 2008-04-27 23:47:47 UTC
You are probably undeploying first which, as designed, will remove the old context fragment.
Comment 4 Zhihong Zhang 2008-05-08 08:17:21 UTC
(In reply to comment #3)
> You are probably undeploying first which, as designed, will remove the old
> context fragment.
> 

You are correct. Looks like the undeploying process removes the context. 

However, I wonder if this is the right behavior. Should Tomcat only remove the context if the app is deployed from WAR?

Zhihong