Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Troubleshoot deployment
Reducing annotation searches during application deployment
Enterprise applications that contain many classes with annotations might take a long time to deploy. Java EE 5 introduced annotations to add metadata to Java classes. Because of performance issues associated with reflection and because classes are not always loadable at deployment, bytecode scanning technology is used to retrieve annotation metadata. Java EE 5 or later applications with many classes might experience long deployment times because every class within the application is inspected during deployment. We can reduce the number of annotations to inspect by specifying the modules and Java packages to ignore for annotations processing in the amm.filter.properties file or by configuring system properties.
Install an application that supports Java EE 5 or later on a product server or cluster. If deployment is unreasonably slow and you will be deploying this application again in the future, complete a procedure in this topic to reduce the number of classes that are searched for annotations during deployment.
The product provides a configurable filtering function to reduce the number of classes that are searched for annotations. We can identify which modules or Java packages to ignore for annotations processing through two properties:
- Ignore-Scanning-Archives
- Ignore-Scanning-Packages
A default set of values is provided in the amm.filter.properties file in WAS_HOME/properties. The property values provide both coarse and fine grained control over the search scope for annotations processing. Use of the Ignore-Scanning-Archives property reduces deployment time more than use of the Ignore-Scanning-Packages property. The syntax for the Ignore-Scanning-Archives and Ignore-Scanning-Packages properties follows the comma-separated value convention. No wildcard or regular expressions are permitted and values are case-sensitive.
The default set of values can be changed by an administrator or augmented by a user using one of the following steps.
Procedure
- Place an amm.filter.properties file in the PROFILE_ROOT/properties directory.
- Use system properties to supply values for the Ignore-Scanning-Archives and Ignore-Scanning-Packages properties.
- The com.ibm.ws.amm.scan.context.filter.archives system property supplies values for the Ignore-Scanning-Archives property.
- The com.ibm.ws.amm.scan.context.filter.packages system property supplies values for the Ignore-Scanning-Packages property.
See the topic on Java virtual machine custom properties.
- Add Ignore-Scanning-Archives and Ignore-Scanning-Packages entries to the application manifest, META-INF/MANIFEST.MF. When updating the application manifest, follow line-length limitations and other constraints for the manifest.
- Add Ignore-Scanning-Archives and Ignore-Scanning-Packages entries to the module manifest. When updating the module manifest, follow line-length limitations and other constraints for the manifest.
What to do next
Install the application again. If deployment continues to be slow, specify more modules and Java packages to ignore.
Troubleshoot deployment
Related
Java virtual machine custom properties