Comments on: Tomcat 7 startup time with metadata-complete https://blog.kaliatech.com/2012/02/tomcat-7-startup-time-with-metadata-complete/ Required reading IMO. Wed, 31 Jan 2018 18:36:00 +0000 hourly 1 https://wordpress.org/?v=4.9.8 By: kaliatech https://blog.kaliatech.com/2012/02/tomcat-7-startup-time-with-metadata-complete/#comment-999 Tue, 11 Feb 2014 14:31:00 +0000 http://blog.kaliatech.com/?p=154#comment-999 When using servlet 3.0 annotation processing, the servlet container scans all jars in the /lib directory looking for servlet 3.0 annotations using reflection. If your application works the same regardless of metadata-complete setting, then you are not using servlet 3.0 annotations, and metadata-complete=true is likely causing unnecessary scanning and slower start-up times.

If you are using servlet 3.0 annotations then you might need the scanning if that is how you are declaring and configuring servlets. (i.e. A servlet 3.0 configuration does not require a web.xml if using annotations and metadata-complete=false).

Since writing my post above, others have found the same and provided more supporting info. For example:

* http://stackoverflow.com/questions/9820379/what-to-do-with-annotations-after-setting-metadata-complete-true-which-resolv

A similar, but different, reason for slow Tomcat 7 times related to it’s scanning for TLDs. More info:

* http://stackoverflow.com/questions/17656398/tomcat-7-slow-start-metadata-complete-true-web-xml

]]>
By: Amit https://blog.kaliatech.com/2012/02/tomcat-7-startup-time-with-metadata-complete/#comment-998 Tue, 11 Feb 2014 06:51:00 +0000 http://blog.kaliatech.com/?p=154#comment-998 What does the servlet container do by scanning jar files for annotations and web-fragment.xml’s? If the application still works after adding metadata-complete=true, does it mean this tag just result in lazy class loading and initialization?

]]>