Defining context root entries

About this task

You must add the WAR file mappings for defining the context root in the build.properties.in file. This ensures that the web applications that are installed on single application server have unique context roots.

Note: Multiple EARs or context roots require additional memory for the application server JVM. Testing has shown that the deployment of a second application EAR file requires 2.5 - 3.5 times the memory of a single EAR. Supporting two deployments may require up to 2.5 GB of heap space and 1.2 GB of permanent space.

During installation, you can avoid out-of-memory errors by setting JVM-specific properties (ADDITIONAL_ANT_JAVA_TASK_ARGS and ADDITIONAL_ANT_COMPILER_TASK_ARGS).

To add these entries, do the following:

Procedure

  1. Edit the <INSTALL_DIR>/install/bin/build.properties.in file.
  2. Add the WAR file mappings for the context root paths for any web application. The key should be the name of the application's WAR file. For example,
    platformdemo.war=/myplatformdemo
    yantrawebservices.war=/yantrawebservices
    platformdemodocs.war=/myplatformdemodocs
    If you want to deploy the same WAR file twice, use WAR file mappings like the following example:
    platformdemo1.war=platformdemo,platform
    platformdemo2.war=platformdemo,platform
    Then, during the EAR build, pass the following argument:
    -Dwarfiles=platformdemo1,platformdemo2
  3. Run the following script from the INSTALL_DIR/bin directory to munge the context root WAR file mappings to the build.properties file:
    • setupfiles.sh (for UNIX/Linux)
    • setupfiles.cmd (for Windows)

Results

Note: If you provide yfs.context.namespace property and don't provide the mapping of the WAR files in the build.properties.in file, the buildEAR.cmd (buildear.sh for UNIX/Linux) script will throw an error forcing the user to fill in the WAR file mappings. And if you provide the mapping of the WAR files in the build.properties.in file and don't provide yfs.context.namespace property, the WAR file mappings are ignored.

Also, the yfs.context.namespace property value and the WAR file mappings name should be different for each EAR that you want to deploy on the same application server.