Tomcat 6 + JAva API + Exploded WAR = Skips Deployment

View: New views
1 Messages — Rating Filter:   Alert me  

Tomcat 6 + JAva API + Exploded WAR = Skips Deployment

by xianpants :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm using the Cargo Java API as part of a little functional testing framework and while it's working fantastic with WAR files it's not deploying exploded WARs.

Here's the relevant Cargo code:

// (1) Optional step to install the container from a URL pointing to its distribution
Installer installer = new ZipURLInstaller(new URL("http://www.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.zip"));
installer.install();

// (2) Create the Cargo Container instance wrapping our physical container
LocalConfiguration configuration = (LocalConfiguration) new DefaultConfigurationFactory()
        .createConfiguration("tomcat6x"), ContainerType.INSTALLED, ConfigurationType.STANDALONE);
container = (InstalledLocalContainer) new DefaultContainerFactory()
        .createContainer("tomcat6x", ContainerType.INSTALLED, configuration);
container.setHome(installer.getHome());

// (3) Statically deploy some WAR (optional)
WAR deployable = new WAR("./webapp-testing-webapp/target/webapp-testing-webapp-1.0/"); // .war works like a charm.
deployable.setContext("ROOT");
configuration.addDeployable(deployable);

// (4) Start the container
container.start();

I confirmed that the directory exists and is a valid exploded WAR.  The same code snippet works great if I specify the path to the WAR file instead.

I tracked down the problem to TomcatCopyingInstalledLocalDeployer.deployExpandedWar:141.  shouldCopyWars is false so super.deployExpandedWar(..) isn't called.  I'm not explicitly setting shouldCopyWars to false; AbstractCatalinaStandaloneLocalConfiguration is doing that on line 185.

Any suggestions?  Is this a bug or am I missing something?

Thanks,
Christian

PS: I'm using Cargo 1.0.

--
Christian Nelson -- (e) cnelson@... -- (m) 415-378-3988