When starting the application or compiling JSP via ant, Tomcat 7 Jasper complains about superfluous or misplaced JAR file. I got below message
**compile-jsp:**
[jasper] Jul 31, 2012 7:15:15 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar
[jasper] 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.
how to Skipping unneeded JARs during scanning can improve startup time and JSP compilation time in tomcat?
how to enable better output?
If it helps anyone, I just appended the contents of the below output file to the existing
org.apache.catalina.startup.TldConfig.jarsToSkip=
entry.Note that
/var/log/tomcat7/catalina.out
is the location of your tomcat log.Hope that helps.
None of the above worked for me (tomcat 7.0.62)... As Sensei_Shoh notes see the class above the message and add this to logging.properties. My logs were:
so I added
in conf/logging.properties
After that I got so many "offending" files that I did not bother skipping them (and also reverted to normal logging...)
If the extra entries in the log bother you but an extra second of start-up time doesn't, just add this to your
logging.properties
and forget about it:The warning comes up because Tomcat scans all Jars for TLDs (Tagging Library Definitions).
Step1: To see which JARs are throwing up this warning, insert he following line to tomcat/conf/logging.properties
Now you should be able to see warnings with a detail of which JARs are causing the intial warning
Step2 Since skipping unneeded JARs during scanning can improve startup time and JSP compilation time, we will skip un-needed JARS in the
catalina.properties
file. You have two options here -tomcat.util.scan.StandardJarScanFilter.jarsToSkip
. But this can get cumbersome if you have a lot jars or if the jars keep changing.tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*
to skip all the jarsYou should now not see the above warnings and if you have a considerably large application, it should save you significant time in deploying an application.
Note: Tested in Tomcat8
The error message states which logger it is using, so set that logger
.level
:So the logger is
org.apache.jasper.compiler.TldLocationsCache
. In yourlogging.properties
file, add this line:The above solution did not work for me. Instead I simply removed the hash(#) from the last line of the logging.properties file, to make it work.
The next step is to add the jars that Tomcat 7 is looking for in catalina.properties files just after the following line