Issue Details (XML | Word | Printable)

Key: CACTUS-79
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vincent Massol
Reporter: Daniel Rabe
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Cactus

cactus task doesn't delete old webapp if tmpdir is specified on tomcat5x

Created: 27/Nov/03 05:39 AM   Updated: 17/Apr/04 03:42 PM
Return to search
Component/s: Ant Integration
Affects Version/s: 1.5
Fix Version/s: 1.6

Time Tracking:
Not Specified

Environment:
Operating System: Windows XP
Platform: PC

Bugzilla Id: 25034


 Description  « Hide
I have an ant script that runs cactus against a tomcat5x container. By default,
the cactus was is deployed to a system temp directory. When I run this task
more than once, I usually see lines like this, indicating that cactus is
cleaning up the previous webapp:

[cactus] Deleting 1089 files from C:\DOCUME~1\Drabe\LOCALS~1
\Temp\cactus\tomcat5x
[cactus] Deleted 295 directories from C:\DOCUME~1\Drabe\LOCALS~1
\Temp\cactus\tomcat5x

The tomcat5x container allows you to specify your own temp directory. I specify
mine as <tomcat5x ... tmpdir="c:\temp"/>. When I execute it this way, it
creates c:\temp\webapps, and puts my war file in there. When I re-run the
cactus task, it copies over a new war file, but does NOT delete the previously
exploded webapp. Therefore, it ends up executing an old version of the webapp.

I don't see any reason why the behavior should be different if I specify my own
tmpdir. I would expect the old webapp to be deleted when the new war file is
copied over.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vincent Massol added a comment - 26/Jan/04 04:53 AM
Fixed in CVS HEAD. Could you please verify it works? I'll be uploading a
nightly build in a few hours.

Thanks
-Vincent

Daniel Rabe added a comment - 29/Jan/04 08:56 AM
It works fine if and only if there is actually something in the specified
directory. If the directory doesn't exist, the ant task gives me a stack trace
and then just hangs (doesn't exit, and doesn't use CPU). Here is what I see:

   [cactus] Adding Cactus client system property [cactus.servletRedirectorName]
with value [ServletRedirector]
   [cactus] Adding Cactus server system property [cactus.contextURL] with value
[null]
   [cactus] -----------------------------------------------------------------
   [cactus] Running tests against Tomcat 5.0.18
   [cactus] -----------------------------------------------------------------
   [cactus] Starting up container
C:\temp\cactus-test not found.
        at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner
(AbstractFileSet.java:369)
        at org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:483)
        at
org.apache.cactus.integration.ant.container.AbstractContainer.cleanTempDirectory
(AbstractContainer.java:462)
        at
org.apache.cactus.integration.ant.container.AbstractContainer.prepareTempDirecto
ry(AbstractContainer.java:421)
        at
org.apache.cactus.integration.ant.container.tomcat.AbstractCatalinaContainer.pre
pare(AbstractCatalinaContainer.java:225)
        at
org.apache.cactus.integration.ant.container.tomcat.Tomcat5xContainer.startUp
(Tomcat5xContainer.java:97)
        at org.apache.cactus.integration.ant.container.ContainerRunner$1.run
(ContainerRunner.java:179)
        at java.lang.Thread.run(Thread.java:534)

Vincent Massol added a comment - 14/Feb/04 10:48 PM
Ok, I think I've fixed it in CVS HEAD today. Please reopen if there's still a
problem. Thanks!