https://issues.apache.org/bugzilla/show_bug.cgi?id=57507
Bug ID: 57507 Summary: Deploying new Context fails if the context file is already present in the catalina directory Product: Tomcat 7 Version: 7.0.55 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: joekis...@gmail.com Deploying new Context fails if the context file is already present in the catalina directory This worked in 7.0.52, and does not work in 7.0.55 and 7.0.57. I did not test the intervening verions to figure out which release introduced the issue. Here's how to reproduce: 1) Start tomcat 2) Place a new context file into the catalina context directory here: /var/lib/tomcat/conf/Catalina/localhost/test.xml 3) Tell tomcat there's a new context: Goto URL: http://webserver/tomcat-manager-app/deploy?path=/test&config=file:///var/lib/tomcat/conf/Catalina/localhost/test.xml" 4) Deploy fails with this message: FAIL - Failed to deploy application at context path /test Previously it would deploy fine. It appears that deploying does not work if the source of your context file is it's final destination. I traced a chunk of the code, and this is being caught by a generic "something bad happened during the deploy"... I didn't see any useful debug messages or why it's failing. After it fails, it deletes the test.xml file. A work around would be to create a secure temporary directory to write the context files to and give that path to catalina. Unfortunately that workaround isn't terribly exciting for us for a few reasons: 1) We need to be able to deploy context's when tomcat is not running, and we do that by writing the context file in directly 2) Creating a single purpose secure temporary directory with the correct permissions, owner and group would be cumbersome to create and manage 3) After tomcat copies the context file, we would need to manage the ownership and permissions of the context files. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org