[Building Sakai] Tomcat 7.0.29+ adds a few minutes to startup

Steve Swinsburg steve.swinsburg at gmail.com
Mon Nov 5 20:49:45 PST 2012


I ran some tests on this.

Tomcat 7.0.32 has a separate property that can be used to disable the scanning of jars but which doesn't seem to affect the TLD related jars:

# Additional JARs (over and above the default JARs listed above) to skip when
# scanning for Servlet 3.0 pluggability features. These features include web
# fragments, annotations, SCIs and classes that match @HandlesTypes. The list
# must be a comma separated list of JAR file names.
org.apache.catalina.startup.ContextConfig.jarsToSkip=*.jar

With that setting I was able to reduce my normal full trunk startup time from 175 seconds to 89. All tools seems to be functional.

There is an additional setting:

# Additional JARs (over and above the default JARs listed above) to skip when
# scanning for TLDs. The list must be a comma separated list of JAR file names.
org.apache.catalina.startup.TldConfig.jarsToSkip=

But if you add *.jar to that then nothing that needs a TLD works ;) 

Likewise with the default list:
tomcat.util.scan.DefaultJarScanner.jarsToSkip=

The bottom line, It looks like you can set just this property in catalina.properties to reduce your startup time:
org.apache.catalina.startup.ContextConfig.jarsToSkip=*.jar

cheers,
Steve



On 06/11/2012, at 2:20 PM, Matthew Jones <matthew at longsight.com> wrote:

> FYI: 
> 
> Adding this option to the property saves a minute in startup costs, *but* seems to break most (all?) tools that use JSTL, JSF or Spring MVC that don't have the taglibs available in the META-INF (seemingly most every tool in Sakai)
> 
> This includes Chat, Forums, Gradebook, Podcasts, Postem, BasicLTI, Roster, etc
> caused by: javax.servlet.ServletException: Servlet.init() for servlet Faces Servlet threw exception
>     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1147)
> caused by: java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions
> 
> 
> . . .
> So seriously for development only. It would be a *nice* to fix this issue though. :)
> 
> 
> On Thu, Nov 1, 2012 at 11:31 AM, Matthew Jones <matthew at longsight.com> wrote:
> It seems like the alternative is to add *every* Sakai jar to this list
> individually (probably a huge list) as it was suggested here [1].
> "INFO: At least one JAR was scanned for TLDs yet contained no TLDs.
> Enable debug logging for this logger for a complete list of JARs that
> were scanned but no TLDs were found in them. Skipping unneeded JARs
> during scanning can improve startup time and JSP compilation time."
> 
> It was suggested changing the log level to debug would list every
> individual jar. A comment on this post said that adding all of the
> used taglibs to META-INF could also resolve this scanning problem, but
> that looks like it could be a lot of work as well. Possibly something
> to consider.
> 
> This seems like a great option for development (1 minute restart of
> all tools is really nice) and also lowers the memory requirements
> needed for startup (as a lot of memory is needed for this tag
> scanning).
> 
> [1] http://thinkinginsoftware.blogspot.com/2011/10/tomcat-7-scans-all-jars-for-tlds.html
> 
> On Thu, Nov 1, 2012 at 11:10 AM, Earle Nietzel <earle.nietzel at gmail.com> wrote:
> > In recent testing with the current tomcat version 7.0.32 I experienced 2 or
> > 3 times longer startups of Sakai.
> >
> > Looking at the Tomcat change logs,
> > http://tomcat.apache.org/tomcat-7.0-doc/changelog.html
> > noticed in 7.0.29 they enabled scanning for servlet 3 features.
> >
> > This scan will scan all jars for servlet 3 annotations.
> >
> > They added an option to skip this scanning called: jarsToSkip
> >
> > Since Sakai at this point doesn't use Servlet 3 spec, that I can recall, you
> > can configure it to skip all jars with adding *.jar to all of the
> > *.jarsToSkip properties in conf/catalina.properties.
> >
> > My startup is now back to approx 65 seconds!
> >
> > Enjoy,
> > Earle
> >
> > _______________________________________________
> > sakai-dev mailing list
> > sakai-dev at collab.sakaiproject.org
> > http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> >
> > TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org
> > with a subject of "unsubscribe"
> 
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20121106/6a376aa3/attachment.html 


More information about the sakai-dev mailing list