Disable annotation scanning when an app is deployed in WebSphere (metadata complete)

Home > Search
  by

By default, when an app is deployed or restarted, the annotations in the app will be scanned. For example, lets consider an app that has a few annotations. The scanning of each annotation in the app will increase the time it takes to deploy or restart the app. Disabiling annotation scanning should reduce the time it takes to deploy or restart the app.

@Annotation1
@Annotation2
@Annotation3
public class People {
    . . .
}

 

There are two ways that annotation scanning can be disabled. You can either add metadata-complete="true" to the apps web.xml file, or you can enable the metadata-complete attribute in the WebSphere admin console.

web.xml

<web-app 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"
version="2.5">

 

If deploying the app using the WebSphere admin console, you can select the metadata-complete attribute to disable annotation scanning when the app is deployed or restarted.

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments