Skip to content

Speeding up Slow Jetty 8 Startups

March 10, 2012

A few weeks ago our Jetty startup time went from 8 seconds to over 60. We discovered it was searching every class in every jar in WEB-INF/lib and WEB-INF/classes for the JEE annotations, e.g. annotations such as @WebFilter which replace fragments inside the web.xml file. This is normal behavior, according to many sources, and no fault of Jetty’s. However, a quick search for javax.servlet.annotation showed that we were not using any of these. Adding ‘metadata-complete=”true”‘ to our web.xml’s web-app restored our startup time to 8 seconds.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns=""

This attribute tells the container that the web.xml contains the complete configuration. I think this is a fairly well-known topic, but worth (re)posting if it saves someone else some time.


From → Uncategorized

  1. Thanks, this was very useful.

  2. Rafael Rocha permalink

    Thanx man really usefull!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s