Disable TLD scanning at appengine initialization
Asked Answered
H

1

9

This thread is similar to: Disable taglib scanning in google app engine (Jetty)

The author of that thread accepted a wrong answer.

We were trying to reduce the appengine startup time of my instances I've come accross the taglib TLD classpath scanning.

My application has 50mb of jars. The scanning of the tld takes 20% of the startup time:

enter image description here

(Image from Yourkit capture of the startup time). You can also set logger.properties level to ALL and you will see the classpath scanning issue going on.

Is there a way to disable that on appengine? God forbid us to have anything to do with taglibs, JSP, or anything like that! We have a very slick velocity + spring-mvc container.

Again, the issue is very clear: appengine doesn't respect "org.mortbay.jetty.webapp.NoTLDJarPattern" configuration in web.xml

This thing is killing our service! Our boot time is going over 60 seconds and we need to do anything to reduce that.

Hannus answered 12/7, 2013 at 9:0 Comment(6)
Have you filed an issue yet in the appengine project? code.google.com/p/googleappengineAldous
Just a hunch, but have you tried renaming your JARs to match the NoTLDJarPattern used by AppEngine's webdefault.xml? It's not pretty, but maybe naming all your JARs e.g. jetty-(...).jar helps. Alternatively, repackage all JARs into one big JAR and just give that a name covered by AppEngine's NoTLDJarPattern.Woermer
Philipp, I haven't tried that. I use maven to package my project, it seems tricky to do that. Any chance you have tried that?Hannus
Philipp, I have just done the trick of renaming all the jars to "jetty-". Thank you so much for the suggestion. Let's see if it changes anything. My module is still taking 18 seconds to boot :(Hannus
@PhilippReichard it seems it worked. The module is consistently booting at 13-15 seconds, while before it was 20.Hannus
@RafaelSanches Glad that worked! I posted my comment as answer below so we can get this question off the 'unanswered' list.Woermer
W
1

Posting my comment from above as answer:

Rename your JARs to match the NoTLDJarPattern used by AppEngine's webdefault.xml.

It's not pretty, but naming all your JARs e.g. jetty-(...).jar should prevent them from being scanned for TLDs.

Alternatively, repackage all JARs into one big JAR and just give that a name covered by AppEngine's NoTLDJarPattern.

Woermer answered 28/1, 2015 at 22:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.