How to fix the JSP compiler warning: one JAR was scanned for TLD, but does not contain TLD?

When launching an application or compiling JSP through ant Tomcat 7, Jasper complains about a redundant or non-local JAR file. I received a 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 skip unnecessary JARs during scanning can improve startup time and compilation time of JSP in tomcat?

How to enable the best output?

+39
jar logging compilation tld tomcat7
Jan 17 '13 at 9:19
source share
9 answers

For Tomcat 8, I had to add the following line to tomcat/conf/logging.properties for jars verified by Tomcat to display in the logs:

 org.apache.jasper.servlet.TldScanner.level = FINE 
+33
Feb 27 '14 at 15:29
source share
โ€” -

Tomcat 8.5 . Inside catalina.properties, located in the / conf directory:

 tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar 

Or go to context.xml located in the Tomcat / conf directory and add:

 <JarScanner scanClassPath="false"/> 
+17
Sep 06 '16 at 21:55
source share

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.

 # To see debug messages in TldLocationsCache, uncomment the following line: org.apache.jasper.compiler.TldLocationsCache.level = FINE 

The next step is to add the banks that Tomcat 7 looks for in the catalina.properties files immediately after the next line

 org.apache.catalina.startup.TldConfig.jarsToSkip= 
+15
Sep 24 '13 at 17:29
source share

If this helps someone, I just added the contents of the underlying output file to an existing org.apache.catalina.startup.TldConfig.jarsToSkip= entry.

Note that /var/log/tomcat7/catalina.out is the location of your tomcat log.

 egrep "No TLD files were found in \[file:[^\]+\]" /var/log/tomcat7/catalina.out -o | egrep "[^]/]+.jar" -o | sort | uniq | sed -e 's/.jar/.jar,\\/g' > skips.txt 

Hope this helps.

+9
May 10 '14 at 23:42
source share

For Tomcat 8, I had to add the following line to the .properties catalogs to prevent Tomcat banks from scanning:

 tomcat.util.scan.StandardJarScanFilter.jarsToSkip=jsp-api.jar,servlet-api.jar 
+4
Jan 26 '16 at 11:03
source share

Uncomment this line (in /conf/logging.properties )

 org.apache.jasper.compiler.TldLocationsCache.level = FINE 

Work with me in tomcat 7.0.53 !

+3
Apr 29 '14 at 13:23
source share

None of the above worked for me (tomcat 7.0.62) ... Since Sensei_Shoh notes see the class above the message and add it to logging.properties. My magazines:

 Jan 18, 2016 8:44:21 PM org.apache.catalina.startup.TldConfig execute 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. 

so i added

 org.apache.catalina.startup.TldConfig.level = FINE 

in conf / logging.properties

After that, I got so many โ€œoffensiveโ€ files that I did not skip them (and also returned to normal logging ...)

+3
Jan 20 '16 at 10:14
source share

The error message indicates which logger it is using, so install this .level :

 [jasper] Jul 31, 2012 7:15:15 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar 

So, the registrar is org.apache.jasper.compiler.TldLocationsCache . In the logging.properties file logging.properties add the following line:

 org.apache.jasper.compiler.TldLocationsCache.level = FINE 
+1
Jan 06 '16 at 21:49
source share

A warning appears because Tomcat scans all Jars for TLDs (tag tag definitions).

Step 1 . To find out which JAR servers throw this warning, insert it in the following line: tomcat / conf / logging.properties

 org.apache.jasper.servlet.TldScanner.level = FINE 

You should now be able to see warnings with details from which JARs trigger an internal warning.

Step 2 Since skipping unnecessary JARs during scanning can improve startup time and JSP compilation time, we will skip unnecessary JARS in the catalina.properties file. Here you have two options -

  • List all the JARs under tomcat.util.scan.StandardJarScanFilter.jarsToSkip . But it can become cumbersome if you have a lot of jugs or if the banks keep changing.
  • Alternatively Insert tomcat.util.scan.StandardJarScanFilter.jarsToSkip=* to skip all banks

Now you should not see the above warnings, and if you have a significant application, this should save you significant time in deploying the application.

Note. Tested in Tomcat8

+1
Aug 18 '17 at 8:12
source share



All Articles