title: Error: Could not find or load main class org.apache.catalina.startup.Bootstrap
body: <p>I'm using cargo-maven2-plugin to run tomcat for integration tests. It worked fine when 7x container is used. I recently upgraded it to 9x and it works fine on a Ubuntu/Linux machine but doesn't work on a Mac (running the latest OS version). </p>
  
  <p>When I peek into the container logs it lists the following logs:</p>
  
  <pre><code>Error: Could not find or load main class org.apache.catalina.startup.Bootstrap
  Listening for transport dt_socket at address: 7998
  Error: Could not find or load main class org.apache.catalina.startup.Bootstrap
  </code></pre>
  
  <p>When I peek into the cargo logs it lists the following logs:</p>
  
  <pre><code>The ' characters around the executable and arguments are
  not part of the command.
  [10:46:34.640][debug][talledLocalContainer]    +Task: java
  [10:46:34.642][debug][talledLocalContainer] dropping /Users/myprojectpath/target/tomcat-9.0.22/bin/tomcat-juli.jar from path as it doesn't exist
  [10:46:34.642][debug][talledLocalContainer] dropping /Users/myprojectpath/target/tomcat-9.0.22/bin/bootstrap.jar from path as it doesn't exist
  [10:46:34.643][debug][talledLocalContainer] dropping /Users/myprojectpath/target/tomcat-9.0.22/bin/tomcat-juli.jar from path as it doesn't exist
  [10:46:34.643][debug][talledLocalContainer] dropping /Users/myprojectpath/target/tomcat-9.0.22/bin/bootstrap.jar from path as it doesn't exist
  [10:46:34.643][debug][talledLocalContainer] Executing '/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/bin/java' with arguments:
  '-Xdebug'
  '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7998'
  '-DprocessName=central'
  '-Xms256m'
  '-Xmx512m'
  '-Dfile.encoding=utf-8'
  '-Dhsqldb.database=/Users/myprojectpath/target/tomcat-9.0.22/tomcat/hsqldb/myprojectdbname'
  '-Dhsqldb.dbname=myprojectdbname'
  '-Dhsqldb.port=9001'
  '-Duser.language=en'
  '-Dcatalina.home=/Users/myprojectpath/target/tomcat-9.0.22'
  '-Dcatalina.base=/Users/myprojectpath/target/tomcat-9.0.22/tomcat'
  '-Djava.io.tmpdir=/Users/myprojectpath/target/tomcat-9.0.22/tomcat/temp'
  '-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager'
  '-Djava.util.logging.config.file=/Users/myprojectpath/target/tomcat-9.0.22/tomcat/conf/logging.properties'
  '-classpath'
  '/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/tools.jar'
  'org.apache.catalina.startup.Bootstrap'
  'start'
  </code></pre>
  
  <p>Here's the configuration/setup for the plugin:</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;configuration&gt;
        &lt;configuration&gt;
            &lt;properties&gt;
                &lt;cargo.wait&gt;false&lt;/cargo.wait&gt;
                &lt;cargo.jvmargs&gt;${jvm.debug.options} -DprocessName=central -Xms256m -Xmx512m -Dfile.encoding=utf-8 -Dhsqldb.database=${catalina.home}/hsqldb/myprojectdbname -Dhsqldb.dbname=myprojectdbname -Dhsqldb.port=9001 -Duser.language=en&lt;/cargo.jvmargs&gt;
            &lt;/properties&gt;
        &lt;/configuration&gt;
        &lt;deployables&gt;
        ....
        &lt;/deployables&gt;
        &lt;/configuration&gt;
    &lt;executions&gt;
        &lt;execution&gt;
            &lt;id&gt;start-container&lt;/id&gt;
            &lt;phase&gt;package&lt;/phase&gt;
            &lt;goals&gt;
                &lt;goal&gt;start&lt;/goal&gt;
            &lt;/goals&gt;
        &lt;/execution&gt;
        &lt;execution&gt;
            &lt;id&gt;stop-container&lt;/id&gt;
            &lt;phase&gt;post-integration-test&lt;/phase&gt;
            &lt;goals&gt;
                &lt;goal&gt;stop&lt;/goal&gt;
            &lt;/goals&gt;
        &lt;/execution&gt;
    &lt;/executions&gt;
  &lt;/plugin&gt;
  
  &lt;profile&gt;
      &lt;id&gt;tomcat9x&lt;/id&gt;
      &lt;activation&gt;
          &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
      &lt;/activation&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.cargo&lt;/groupId&gt;
                  &lt;artifactId&gt;cargo-maven2-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;container&gt;
                          &lt;containerId&gt;tomcat9x&lt;/containerId&gt;
                          &lt;artifactInstaller&gt;
                              &lt;groupId&gt;com.mycomapany.tomcat&lt;/groupId&gt;
                              &lt;artifactId&gt;tomcat&lt;/artifactId&gt;
                              &lt;version&gt;${catalina.version}&lt;/version&gt;
                              &lt;type&gt;zip&lt;/type&gt;
                              &lt;extractDir&gt;${project.build.directory}&lt;/extractDir&gt;
                          &lt;/artifactInstaller&gt;
                          &lt;output&gt;${project.build.directory}/container.log&lt;/output&gt;
                          &lt;append&gt;false&lt;/append&gt;
                          &lt;log&gt;${project.build.directory}/cargo.log&lt;/log&gt;
                          &lt;timeout&gt;600000&lt;/timeout&gt;
                      &lt;/container&gt;
                      &lt;configuration&gt;
                          &lt;type&gt;existing&lt;/type&gt;
                          &lt;home&gt;${catalina.home}&lt;/home&gt;
                          &lt;properties&gt;
                              &lt;cargo.servlet.port&gt;${catalina.port}&lt;/cargo.servlet.port&gt;
                              &lt;cargo.logging&gt;high&lt;/cargo.logging&gt;
                          &lt;/properties&gt;
                      &lt;/configuration&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/profile&gt;
  &lt;/profiles&gt;
  &lt;properties&gt;
  &lt;catalina.port&gt;12345&lt;/catalina.port&gt;
  &lt;catalina.home&gt;${project.build.directory}/tomcat-${catalina.version}/tomcat&lt;/catalina.home&gt;
  &lt;jvm.debug.options&gt;-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7998&lt;/jvm.debug.options&gt;
  &lt;/properties&gt;
  </code></pre>