I've a new installed tomcat and placed mycontext.xml (conf/Catalina/localhost): <Context docBase="/somewhere/somewhat.war" /> After updating somewhat.war tomcat removes mycontext.xml! So the application will not be deployed correctly. The tomcat docs ("tomcat-docs/config/host.html#Automatic%20Application%20Deployment") says: "An update to a WAR which has been expanded will trigger an undeploy (with a removal of the expanded webapp), followed by a deployment"
I don't think this use case will be handled, sorry. I'll likely mark this as wontfix.
Updating the war means you want to fully redeploy. Your war doesn't contain the context.xml, so no redeployment occurs. You should drop the .xml again after the war update in this case. Sorry, there's no other solution (doing otherwise would break other cases), this is not a bug.
Updating the war means you want to fully redeploy. You should drop the .xml again after the war update in this case. Sorry, there's no other solution (doing otherwise would break other cases), this is not a bug.
*** Bug 34866 has been marked as a duplicate of this bug. ***
(In reply to comment #4) > *** Bug 34866 has been marked as a duplicate of this bug. *** But I don't want to have the context.xml packed inside the WAR, because I use the context XML for defining init parameters which are machine-specific, i.e. which are not part of the web application, they are rather deployment-time parameters. Forcing to pack context descriptor *inside* of the webapp breaks the division of author and deployer, as described by SUN in the blueprintsfor J2EE.
Martin: your problem is not really related, please don't reopen the report. Gernot: I think I have found a way to tweak the order of the resources so that the behavior is better. I found it is possible as Tomcat will never remove any resources which are not inside the Host appBase, so in this case it works well to put the context file first (so it is never removed when a less relevant resource - such as the WAR - is updated). Hopefully, I didn't get it wrong.
I am also experiencing this problem when I use the start/stop deployer commands which worked in version 5.5.7. My normall pattern was to stop the application, then copy an updated war file then start the application. With version 5.5.9 it deletes the <context>.xml file from the conf\Catalina\<host> directory for that context when it is stopped, so I can't start it again. I guess for a redeploy case I should be using undeploy/redeploy which I am not, but what about the case where I want to take the application offline say for a database backup, there is now not a way to start the application again as it can't find the context. Also I agree with the other comments that I don't want to define my data sources within the war file I want to use a per server configuration. I know that I can always modify the war file after it has been created with the context file before deploy but that would just be one extra step for someone to forget. Paul
Please do not reopen the report.