JSR88-compliant containers support |
Cargo supports JSR 88: J2EE Application Deployment API, allowing it to be used with any JSR88-compliant container.
The core functionality is implemented by the o.c.c.container.spi.deployer.AbstractJsr88Deployer
class (a Deployer implementation), which acts as a proxy to the JSR88 DeploymentManager
.
The GlassFish 6.x container doesn't have any remote deployers yet, as GlassFish 6.0 lacks JSR-88 support and it is unclear whether this will be included in a future release. Until then, please follow the remote deployment instructions for GlassFish 6.x.
Recent versions of Payara might have issues getting deployables uploaded via JSR-88, resulting in errors such as:
Distributing failed: Action failed Deploying application to target server failed; File not found |
If you encounter such errors, please follow the remote deployment instructions for recent Payara versions.
The GlassFish 3.x, GlassFish 4.x, GlassFish 5.x and Payara remote containers use the JSR-88 API. For the connection to succeed, the following JARs need to be in the container classpath or in the current Java Thread's context classloader:
Here is an example code for the users of the Java API:
List<URL> urls = new ArrayList<URL>(); // Add many libraries from GlassFish for (File jar : new File(this.localContainer.getHome(), "glassfish/modules").listFiles()) { if (jar.isFile()) { urls.add(jar.toURI().toURL()); } } // Create a ClassLoader contaning all these JARs URL[] urlsArray = new URL[urls.size()]; urlsArray = urls.toArray(urlsArray); URLClassLoader classLoader = new URLClassLoader(urlsArray, Thread.currentThread().getContextClassLoader()); Thread.currentThread().setContextClassLoader(classLoader); // Now, create the GlassFish Remote container ... |
Here is an example Maven 3 plugin configuration:
<plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven3-plugin</artifactId> <version>${cargo.plugin.version}</version> <configuration> <container> <containerId>glassfish3x</containerId> <type>remote</type> </container> <configuration> <type>runtime</type> <properties> <cargo.hostname>virtualbox-xp</cargo.hostname> <cargo.rmi.port>4848</cargo.rmi.port> </properties> </configuration> </configuration> <dependencies> <dependency> <groupId>org.glassfish.deployment</groupId> <artifactId>deployment-client</artifactId> <version>3.0.1</version> </dependency> </dependencies> </plugin> |
When adding the
or
The list of versions you can choose from can be found on:
|
When you configure the GlassFish or Payara server to only use modern versions of TLS (and hence block older TLS versions), you might get an error message such as the below:
That happens because unfortunately even the latest version of the GlassFish Deployment Client dependency uses TLS version 1, and offers to ways to change it. Later versions of the Payara deployment client fix this issue by setting the default to a modern TLS version:
|