WAS v8.5 > Deploy applications > Troubleshooting deploymentReducing annotation searches during application deployment
Enterprise applications containing 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. 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. WAS v8.5 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 app_server_root/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.
- 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.
Install the application again. If deployment continues to be slow, specify more modules and Java packages to ignore.
Related
Troubleshooting deployment
Reference:
Java virtual machine custom properties