...
Note |
---|
This feature is not available on all containers! Currently, the only containers that support shared classpaths are:
On other containercontainers, please change the container classpath instead. |
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 application being executed on a container.
...
Example using the Java API
Here is an example adding a series of common application libraries to the shared classpathStarting a WAR on Tomcat 6.x with some additional classpath entries:
Code Block | ||||
---|---|---|---|---|
| ||||
InstalledLocalContainerLocalConfiguration containerconfiguration = new Tomcat6xInstalledLocalContainer( Tomcat6xStandaloneLocalConfiguration("target/tomcat6x"); Deployable war = new Tomcat6xStandaloneLocalConfigurationWAR("target/tomcat6x")/war/grails-example-without-libs.war"); configuration.addDeployable(war); InstalledLocalContainer container = new Tomcat6xInstalledLocalContainer(configuration); container.setHome("/srv/tomcat/catalina-home"); List<String> jars = new List<String>(); for (File jar : new File("/opt/grails").listFiles()) { if (jar.isFile()) { jars.add(jar.getAbsolutePath()); } } container.setSharedClasspath(jars.toArray()); container.start(); |
Example using the Ant API
Starting Orion 1a WAR on Tomcat 6.x with some additional classpath entries:
Code Block | ||||
---|---|---|---|---|
| ||||
<cargo containerId="tomcat6x" home="/srv/tomcat/catalina-home" action="start">
<sharedClasspath>
<fileset dir="/opt/grails">
<include name="*.jar"/>
</fileset>
</sharedClasspath>
<configuration>
<deployable type="war" file="target/war/grails-example-without-libs.war"/>
</configuration>
</cargo>
|