Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7812199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:26:00+00:00 2026-06-02T04:26:00+00:00

I am trying to implement the solution mentioned in How to specify jetty-env.xml file

  • 0

I am trying to implement the solution mentioned in How to specify jetty-env.xml file for Maven Cargo plugin for Jetty?

However I am facing something even more fundamental: My Cargo is simply not generating any context xml.

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.2.1</version>
    <configuration>
        <!-- Container configuration -->
        <container>
            <containerId>jetty6x</containerId>
            <type>embedded</type>
        </container>
        <!-- Configuration to use with the container or the deployer -->
        <configuration>
            <properties>
                <cargo.servlet.port>${itest.webapp.port}</cargo.servlet.port>
                <cargo.jetty.createContextXml>true</cargo.jetty.createContextXml>
            </properties>
            <deployables>
                <deployable>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>myApp-web</artifactId>
                    <type>war</type>
                    <properties>
                        <context>/myApp</context>
                    </properties>
                </deployable>
            </deployables>
<!--
            <configfiles>
                <configfile>
                    <file>${project.build.outputDirectory}/jetty-env.xml</file>
                    <todir>contexts</todir>
                    <tofile>${jetty6.context}.xml</tofile>
                </configfile>
            </configfiles>
-->
        </configuration>
    </configuration>
    <executions>
        <execution>
            <id>start-container</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>start</goal>
            </goals>
        </execution>
        <execution>
            <id>stop-container</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>stop</goal>
            </goals>
        </execution>
    </executions>
</plugin>

The basic idea is, we are providing the a custom context.xml to replace the one generated. However, when I am trying out, I cannot find any context XML generated by Cargo (Please note that I have remarked the custom config files, and with cargo.jetty.createContextXml being true)

I am not sure if it is my problem in setting causing the context not generated, or the context is generated somewhere I overlooked. I have checked under target/cargo/ and the temp directory that cargo expanded my WAR, neither place contains the context xml.

(I am using Maven 2.2.1, Cargo 1.2.1, JDK 6)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T04:26:01+00:00Added an answer on June 2, 2026 at 4:26 am

    I am not 100% sure what your problem is, but here is what cargo does on my system for Jetty6.

    The directory where the Jetty installation is NOT where the runtime context and webapp files are. In my case, they are stored in the Java temp directory (i.e. java.io.tmpdir). On my Ubuntu system this is /tmp. Under this directory, there is a cargo/conf directory. Under /tmp/cargo/conf I have a contexts directory where the context.xml file is stored — although the actual name of the file is never context.xml it is always named after the web app context.

    In my case, this file is given the same name as the context I configured cargo with. Herein may lie your problem because I noticed that you did not supply a context as I do:

    <deployables>
        <deployable>
           <properties>
             <!-- Web root context URL -->
             <context>${build.appserver.context}</context>
           </properties>
        </deployable>
    </deployables>
    

    Secondly, I also noticed you have commented out the section that places the context.xml file in the right place. Unless you uncomment that, this isn’t going to work.

    Thirdly, did you set the value of the ${jetty6.context} Maven property?

    Fourthly – I think for this to work you need to use a standalone configuration of Jetty. This shouldn’t be a problem as Cargo will automatically download and install it for you. See my config here:

                          <container>
                              <containerId>jetty6x</containerId>
                              <!-- Using Jetty for build portability so type != "remote". For Jetty
                                  would prefer type = "embedded" but we must go with "installed" because jetty-env.xml
                                  file would be ignored. See http://jira.codehaus.org/browse/CARGO-861 -->
                              <type>installed</type>
                              <zipUrlInstaller>
                                  <url>http://dist.codehaus.org/jetty/jetty-6.1.26/jetty-6.1.26RC0.zip</url>
                                  <installDir>${build.working}</installDir>
                              </zipUrlInstaller>
                              <dependencies>
                                  <!-- The following dependencies are added to the servlet container's
                                      classpath as if they were installed by a system admin. In order to be included
                                      here, they need to be listed as dependencies in this pom.xml. -->
                                  <dependency>
                                      <groupId>com.h2database</groupId>
                                      <artifactId>h2</artifactId>
                                  </dependency>
                                  <dependency>
                                      <groupId>com.oracle</groupId>
                                      <artifactId>ojdbc5</artifactId>
                                  </dependency>
                                  <dependency>
                                      <groupId>mysql</groupId>
                                      <artifactId>mysql-connector-java</artifactId>
                                  </dependency>
                                  <dependency>
                                      <groupId>net.sourceforge.jtds</groupId>
                                      <artifactId>jtds</artifactId>
                                  </dependency>
                              </dependencies>
                          </container>
                          <!-- Do not hang and wait for a client, just do it -->
                          <wait>false</wait>
                          <configuration> <!-- Deployer configuration -->
                              <!-- Running Jetty container with type=installed (e.g. local) so
                                  type != "runtime", and we are installing it during this execution for the
                                  sake of portability so type != "existing" -->
                              <type>standalone</type>
                              <properties>
                                  <!-- Use the port number from settings.xml -->
                                  <cargo.servlet.port>${build.appserver.port}</cargo.servlet.port>
                              </properties>
                              <deployables>
                                  <deployable>
                                      <properties>
                                          <!-- Web root context URL -->
                                          <context>${build.appserver.context}</context>
                                      </properties>
                                  </deployable>
                              </deployables>
                              <configfiles>
                                  <configfile>
                                      <file>${basedir}/target/jetty-context.xml</file>
                                      <todir>contexts</todir>
                                      <tofile>${build.appserver.context}.xml</tofile>
                                  </configfile>
                              </configfiles>
                          </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement a file upload solution using app engine and python.
I'm trying to implement a solution using .htaccess and wildcard subdomains so that http://subdomain.example.com
I'm trying to implement this accepted solution for displaying a custom error message: https://stackoverflow.com/a/5229581/141172
Just trying to implement a simple audit logging solution with Grails 2.0.2 and it
I'm trying to implement chained filter dropdown using just javascript - jquery. The solution
The background is : I am trying to implement an automated integration test solution.
I'm trying to decide how to implement a very basic licensing solution for some
I've been trying excessively hard to implement a good open id solution into asp.net
While trying to implement an MVC file upload example on Scott Hanselman's blog. I
I'm trying to implement the solution described here My project is just an asp.net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.