IBM Support

Slow deployment of Java EE 5 applications

Technote (FAQ)


Question

When you attempt to deploy a Java™ EE 5 application, the processing time is very slow.

Cause

Notice
The contents of this technote, along with the list of methods for limiting the impact of annotations, is now available at Metadata for module settings in the Information Center. This technote will be removed at a later date.

The basic problem is that when a module is specified at a Java EE 5 level ( web.xml @2.5, ejb-jar.xml @3.0), processing of the module metadata requires a new step to scan Java annotations data from classes packaged in the module.

For a Web module, that includes both the classes packaged directly within the WAR file (under the WEB-INF/classes directory), and classes that are packaged in JAR files within the WAR file (under the configured "lib" directory). The extra processing step adds a substantial amount of time to the deployment process.

Answer

A configurable filtering function for annotation scanning has been added to 7.0.0.5. Two new properties have been added: Ignore-Scanning-Archives and Ignore-Scanning-Packages. A default set of values is provided in amm.filter.properties file that resides in <WAS_HOME>/properties. See implementation details at PK87053: Java Enterprise Edition Version 5 applications take a long time to deploy.

The following solutions are provided as a work-around in place of updating to 7.0.0.5. These solutions assume that a move to a Java EE 5 level is necessary. If the module level can be kept at a pre-Java EE 5 level, the extra annotations scanning will be completely avoided.

  • If a module is upgraded to a Java EE 5 level, and if the module is known to have no annotations, there is a "metadata-complete" flag in the module descriptor that disables annotations processing for the module. With this option, annotation scanning is bypassed, while Java EE 5 values might still be placed in the descriptor file. For an application which is being migrated, but for which no annotations have been added, the use of "metadata-complete" is recommended.

    For example:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.5"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" metadata-complete="true">
    <display-name>Sample_App</display-name>
    ...
  • If metadata-complete cannot be set, then if possible, it is advised to restructure the application to place utility JAR files, which are known to contain no annotations information, into shared libraries. These are not scanned for annotations.

  • Move the jars to the root of the EAR. Nested archives (for example, a JAR within a WAR, within an EAR) are very cumbersome to search through because of the multiple levels of compression.

Document information

More support for: WebSphere Application Server
Install

Software version: 7.0

Operating system(s): AIX, HP-UX, Linux, Solaris, Windows

Reference #: 1381764

Modified date: 04 June 2009


Translate this page: