title: Cargo hangs while starting GlassFish 4.x and uses up 100% CPU
body: <p>Trying to go with Maven Cargo plugin instead of the Maven GlassFish plugin that doesn't support hot redeploy. Cargo hangs on goals start/run for GlassFish local existing installation and eats up to 100% CPU until I kill it! I tried with a plain text password and then created a password file, same result. Online searching turns up posts with various kinds of Cargo-GlassFish configuration, almost all of them older than the versions I'm using, and didn't help either.
  Maven plugin config and debug log are attached. Any help is appreciated.</p>
  
  <p><code>Environment: Mac OS X Mavericks, Oracle JDK 1.7.0_45, GlassFish-4.0-b89, Maven 3.1.1, cargo-maven2-plugin 1.4.5</code></p>
  
  <p><strong>Maven plugin config</strong></p>
  
  <pre><code>&lt;plugin&gt;
    &lt;groupId&gt;org.codehaus.cargo&lt;/groupId&gt;
    &lt;artifactId&gt;cargo-maven2-plugin&lt;/artifactId&gt;
    &lt;version&gt;1.4.5&lt;/version&gt;
    &lt;configuration&gt;
      &lt;container&gt;
        &lt;containerId&gt;glassfish4x&lt;/containerId&gt;
        &lt;type&gt;installed&lt;/type&gt;
        &lt;output&gt;${glassfish.installDirectory}/glassfish/domains/${glassfish.domainName}/logs/server.log&lt;/output&gt;
        &lt;!-- Fail if not started/stopped within 30 sec --&gt;
        &lt;timeout&gt;30000&lt;/timeout&gt;
      &lt;/container&gt;
      &lt;configuration&gt;
        &lt;type&gt;existing&lt;/type&gt;
        &lt;home&gt;${glassfish.installDirectory}/glassfish&lt;/home&gt;
        &lt;properties&gt;
          &lt;cargo.glassfish.domain.name&gt;${glassfish.domainName}&lt;/cargo.glassfish.domain.name&gt;
          &lt;cargo.remote.username&gt;${glassfish.adminUser}&lt;/cargo.remote.username&gt;
          &lt;cargo.remote.passwordFile&gt;${glassfish.installDirectory}/admin.password&lt;/cargo.remote.passwordFile&gt;
          &lt;!-- Maven sets java.home property to JRE but we want JDK --&gt;
        &lt;/properties&gt;
      &lt;/configuration&gt;
      &lt;deployables&gt;
        &lt;deployable&gt;
          &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
          &lt;artifactId&gt;${project.artifactId}&lt;/artifactId&gt;
          &lt;type&gt;${project.packaging}&lt;/type&gt;
          &lt;properties&gt;
            &lt;context&gt;/${project.artifactId}&lt;/context&gt;
          &lt;/properties&gt;
        &lt;/deployable&gt;
      &lt;/deployables&gt;
    &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p><strong>Debug log</strong></p>
  
  <pre><code>[DEBUG] [2.ContainerStartMojo] Resolved artifact and dependencies:file:/Users/Abhijit/Repositories/maven/org/codehaus/cargo/cargo-core-container-glassfish/1.4.5/cargo-core-container-glassfish-1.4.5.jar]
  [INFO] [2.ContainerStartMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-glassfish:jar:1.4.5 for container glassfish4x
  [DEBUG] Scheduling deployable for deployment: [groupId [name.abhijitsarkar.learning.webservices.jaxws.security], artifactId [calculator-enc], type [war], location [null], pingURL [null]]
  [DEBUG] Initial deployable values: groupId = [name.abhijitsarkar.learning.webservices.jaxws.security], artifactId = [calculator-enc], type = [war], location = [null]
  [DEBUG] Searching for an artifact that matches [name.abhijitsarkar.learning.webservices.jaxws.security:calculator-enc:war:null]...
  [DEBUG] Checking artifact [name.abhijitsarkar.learning.webservices.jaxws.security:calculator-enc:war:null]...
  [DEBUG] Computed deployable values: groupId = [name.abhijitsarkar.learning.webservices.jaxws.security], artifactId = [calculator-enc], classifier = [null], type = [war], location = [/Users/Abhijit/Repositories/git/java-ee/jaxws-security/calculator-enc/target/calculator-enc-0.0.1-SNAPSHOT.war]
  [DEBUG] Setting deployable property [context]:[/calculator-enc] for [/Users/Abhijit/Repositories/git/java-ee/jaxws-security/calculator-enc/target/calculator-enc-0.0.1-SNAPSHOT.war]
  [DEBUG] Invoking setter method public synchronized void org.codehaus.cargo.container.deployable.WAR.setContext(java.lang.String) for deployable org.codehaus.cargo.container.deployable.WAR[calculator-enc-0.0.1-SNAPSHOT.war] with argument /calculator-enc
  [DEBUG] Setting container timeout to [30000]
  </code></pre>