testdriven / psi-probe

Advanced manager and monitor for Apache Tomcat, forked from Lambda Probe
8 stars 1 forks source link

Update WebApp Tomcat 7 #406

Open padcom opened 9 years ago

padcom commented 9 years ago

From bast.r...@gmail.com on May 02, 2014 13:22:22

What steps will reproduce the problem? 1.Use Tomact 7, and provide a Local context file in "conf/Catalina/localhost/.xml"

  1. Update the existing Application What is the expected result? That the context.xml will not be changed. What happens instead? The context will be removed by the Tomact. Because Probe does an undeploy the context before the deploy. For further Information see: https://issues.apache.org/bugzilla/show_bug.cgi?id=56248 What version of Probe are you using? 2.3.3

What environment (browser version, Tomcat version, JVM version, server OS)? Tomcat 7.0.53, Oracle JDK 8, Ubuntu 14.04 Please provide any additional information below. Please see attached patch, this resolves the issue for me. But I have not tested it on other Servlet Containers than Tomcat 7

Attachment: fix.patch

Original issue: http://code.google.com/p/psi-probe/issues/detail?id=406

padcom commented 9 years ago

From MALfunct...@gmail.com on May 13, 2014 06:23:48

We'll want to be careful about how we do this. There are now 3 different deployment options:

  1. Upload a new application. (Fails if context already exists.)
  2. Redeploy an existing application. (Undeploy and deploy, losing any .xml customizations.)
  3. [NEW] Update an existing application. (Replace the .war file and deploy, but preserve any .xml changes.

We'll probably need to revisit the UI.

Status: Accepted
Labels: -Milestone-TBD Milestone-2.4.0 Server-Tomcat-7.0 Patch

padcom commented 9 years ago

From bast.r...@gmail.com on May 13, 2014 06:38:08

I also need to mention the fix does not work under all circumstances. Eg. The Tomcat server.xml has following host configuration: <Host ... unpackWARs="true" autoDeploy="false">

Because deleting the War is not enough at this point, we also need to delete the exploded WAR content. Otherwise it will always use the code from the exploded directory.

I attached a new patch, that add also the delete of this directory. It works in my circumstances, but I'm pretty sure that i have missed some points. Eg. an non-default war-explode-directory?

Attachment: UploadWarController.java.patch

padcom commented 9 years ago

From MALfunct...@gmail.com on May 15, 2014 12:01:32

Seems like it would make more sense to preserve the context.xml file, perform a regular undeploy/redeploy, and restore the context.xml file. I think articulating this in the UI would be easier too: "Preserve existing context.xml file."

Thoughts?