Cargo plugin throws CargoException when deploying on Glassfish - Deployment has failed: null
Asked Answered
O

2

70

I'm trying to deploy web application using Cargo Maven plugin on remote Glassfish server (Edition 3.1.1 (build 12)). Glassfish server as well as Java code located on different Linux servers (Ubuntu). I've configured all necessary properties in pom file and tested deployment on Windows machine. It works. But it fails on Linux Ubuntu with interesting exception:

27-Jun-2012 14:36:05    [ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy (default-cli) on project my-web-project-app: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy failed: Deployment has failed: null -> [Help 1]
27-Jun-2012 14:36:05    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy (default-cli) on project mca-staff-app: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy failed: Deployment has failed: null
27-Jun-2012 14:36:05            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
27-Jun-2012 14:36:05            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
27-Jun-2012 14:36:05            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
27-Jun-2012 14:36:05            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
27-Jun-2012 14:36:05            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
27-Jun-2012 14:36:05            at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
27-Jun-2012 14:36:05            at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
27-Jun-2012 14:36:05            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
27-Jun-2012 14:36:05            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
27-Jun-2012 14:36:05            at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
27-Jun-2012 14:36:05            at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
27-Jun-2012 14:36:05            at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
27-Jun-2012 14:36:05            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
27-Jun-2012 14:36:05            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
27-Jun-2012 14:36:05            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
27-Jun-2012 14:36:05            at java.lang.reflect.Method.invoke(Method.java:597)
27-Jun-2012 14:36:05            at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
27-Jun-2012 14:36:05            at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
27-Jun-2012 14:36:05            at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
27-Jun-2012 14:36:05            at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
27-Jun-2012 14:36:05    Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy failed: Deployment has failed: null
27-Jun-2012 14:36:05            at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
27-Jun-2012 14:36:05            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
27-Jun-2012 14:36:05            ... 19 more
27-Jun-2012 14:36:05    Caused by: org.codehaus.cargo.util.CargoException: Deployment has failed: null
27-Jun-2012 14:36:05            at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.waitForProgressObject(AbstractJsr88Deployer.java:285)
27-Jun-2012 14:36:05            at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.deploy(AbstractJsr88Deployer.java:126)
27-Jun-2012 14:36:05            at org.codehaus.cargo.maven2.DeployerDeployMojo.performDeployerActionOnSingleDeployable(DeployerDeployMojo.java:56)
27-Jun-2012 14:36:05            at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionOnAllDeployables(AbstractDeployerMojo.java:178)
27-Jun-2012 14:36:05            at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDeployerMojo.java:98)
27-Jun-2012 14:36:05            at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:311)
27-Jun-2012 14:36:05            at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
27-Jun-2012 14:36:05            ... 20 more

Did anybody use maven Cargo plugin on Linux for remote application deployment? Or maybe somebody know what is the problem here?

Opaque answered 27/6, 2012 at 13:32 Comment(3)
This maybe related: #26600457 (there are some suggestions too)Comparative
Could you paste the part of your pom.xml describing the deployment with cargo please ? Also, do you run this directly or it is runned by some CI server like jenkins or other ? I remember using Cargo + Glassifsh 3 was pure pain so now I deploy using Glassfish REST API + curl through JenkinsNephrectomy
A null pointer exception indicates that a return value inside the code was not handled correctly (like using the result of a method unconditionally). If this happens again a bug report should be created against the cargo plugin.Tude
S
1

The default password is adminadmin. In case you have no password, then use “” using Cargo as password will lead to an error, if the password field is empty.

Use below code

<plugin>
   <groupId>org.codehaus.cargo</groupId>
   <artifactId>cargo-maven2-plugin</artifactId>
   <version>1.7.16</version>
   <executions>
      ...
   </executions>
</plugin>
<execution>
   <id>deploy</id>
   <phase>pre-integration-test</phase>
   <goals>
      <goal>start</goal <goal>redeploy</goal>
   </goals>
</execution>
<execution>
   <id>undeploy</id>
   <phase>post-integration-test</phase>
   <goals>
      <goal>undeploy</goal>
      <goal>stop</goal>
   </goals>
</execution>
Sabrasabre answered 17/11, 2021 at 14:22 Comment(0)
O
1

There may be a glitch in the full path for the execution on the server. AFAIK apps are usually built on the server that does not occur. Windows uses backslash, but Linux does not accept backslash in paths. If the compile was on Win do it all again through a Linux box.

Overthrust answered 25/9, 2022 at 12:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.