tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
Subject Re: Support for a jarsToInclude property?
Date Fri, 29 Jul 2011 22:27:31 GMT
2011/7/30 Michael Youngstrom <>:
> I'm working with Tomcat 7 using web xml fragements and Servlet annotations.
>  When metadata-complete="false" startup time is bad.  It can be improved by
> excluding jars using tomcat.util.scan.DefaultJarScanner.jarsToSkip.  This is
> great except now everytime I add a jar I need to add it to this list to keep
> my startup time good.  I also want to be very careful about what jars are
> adding configuration to my servlet container.  I would like to be able to
> selectively allow these jars to be involved in scanning and then disable all
> other jars.
> It would seem that for my use case adding
> a  tomcat.util.scan.DefaultJarScanner.jarsToInclude property would be very
> useful.  Then I could do something like:
>  tomcat.util.scan.DefaultJarScanner.jarsToSkip=*.jar
>  tomcat.util.scan.DefaultJarScanner.jarsToInclude=spring-web*.jar,some-other*.jar
> Or if there is a collection of jars with a similar pattern that I know don't
> need to be scanned except for maybe one or two I can do something like:
>  tomcat.util.scan.DefaultJarScanner.jarsToSkip=spring-*.jar
>  tomcat.util.scan.DefaultJarScanner.jarsToInclude=spring-web*.jar
> Included jars would take precedence over skipped jars.

1. I think it is OK. The example with spring framework is a good one.

Setting jarsToSkip=*.jar (or just an empty string) as the global
value, though, will affect other unsuspecting web applications that
you could deploy on the same host.

2. Note that you can configure JarScanner element in context.xml.
Maybe it is worth to add a pair of such attributes (skip/include)

3. There are several tasks performed by JAR scanner one is the
scanning for servlets and fragments.  Another one is scanning for TLD

Note:  Jar scanning for TLDs is performed only when compiling a page
that has tags in it. So, to reproduce the message printed by
TldLocationsCache one has to remove compiled JSP pages and request
loading such a page with a web browser.

Also here is interaction between Catalina (servlet container) and
Jasper (JSP compiler).

4. I wonder how JarScanner is configured and used when precompiling JSP pages.

> Thoughts?  I'd be happy to provide a patch if others think such a feature
> would be useful?

At least it would be some exercise to study Tomcat code.

5. I thought maybe JarScanner could be taught to ignore some paths,
e.g. ${java.home}. This is a different issue, though.

Best regards,
Konstantin Kolinko

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message