Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Definition

Excerpt

Explain how to perform debugging when something doesn't work in Cargo

 

Sometimes, it can happen that the container does not start or stop as expected or you might have reasons to believe that CARGO is "acting weird". Here is a short list of things you can do to try debugging the problem.

...

Code Block
xml
xml
<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <version>${cargo.version}</version>
  <configuration>
    <container>
      <containerId>jonas5x</containerId>
      <type>installed</type>
      <home>${jonas.root}</home>
    </container>
    <configuration>
      <type>existing</type>
      <home>${jonas.base}</home>
      <properties>
        <cargo.servlet.port>${http.port}</cargo.servlet.port>
      </properties>
    </configuration>
  </configuration>
  <executions>
    <execution>
      <id>run</id>
      <configuration>
        <configuration>
          <properties>
            <cargo.jvmargs>
              -Xdebug
              -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
              -Xnoagent
              -Djava.compiler=NONE
            </cargo.jvmargs>
          </properties>
        </configuration>
      </configuration>
      <goals>
        <goal>run</goal>
      </goals>
    </execution>
  </executions>
</plugin>
Note
titleMake sure the Debug arguments are only on one goal

Please remember to map the Debug arguments to only one goal; else you will get exceptions such as the below when you try to stop your container:


[INFO] [talledLocalContainer] FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
[WARNING] [talledLocalContainer] ERROR: transport error 202: bind failed: Address already in use
[WARNING] [talledLocalContainer] ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
[WARNING] [talledLocalContainer] JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:741]

 

Once the server is started, follow these steps to remotely debug your server and/or application:

...