This page last changed on Feb 26, 2011 by alitokmen.

Definition

How to configure the executing container's classpath

This feature is only available for local containers

Explanation

This topic is not about the classpath requirements to run Cargo (see the Installation page for this); it's about configuring the classpath for the executing container. For most containers, Cargo automatically manages the container's classpath by adding the required container JARs to it. However, some containers support being embedded. This is the case of Jetty and the Jetty4xEmbeddedContainer implementation class (for example) simply starts the container in the running JVM. Thus you'll need to ensure to have the Jetty JAR + all the other related JARs required (jasper-compiler and jasper-runtime jars specifically).

In addition, for all non-embedded container implementations it is possible to add custom JARs to the container's execution classpath as shown below.

Example using the Java API

Starting Orion 1.x with Clover jar added to its classpath. For example if you have instrumented your source code with Clover you'll need to add the Clover jar to the classpath.

InstalledLocalContainer container = new Orion1xInstalledLocalContainer(
    new OrionStandaloneLocalConfiguration("target/orion1x"));
container.setHome("c:/apps/orion-1.6.0b");

container.setExtraClasspath(new String[] { "libs/clover.jar" });

container.start();

Example using the Ant API

Starting Orion 1.x with some additional classpath entries:

<cargo containerId="orion1x" home="c:/apps/orion-1.6.0b" action="start">
  <extraClasspath>
    <pathelement location="libs/clover.jar"/>
  </extraClasspath>
</cargo>

Example using the Maven 2 Plugin

See Starting and stopping a container - Adding jars to a container's classpath

Document generated by Confluence on May 05, 2011 19:53