Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

At least one JAR was scanned for TLDs yet contained no TLDs

I keep getting this on tomcat 7.30 (eclipse juno)

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.

Well I went at conf\logging.properties and turned all INFO to FINE and uncommented the line

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

And I still see At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging...

So what should I do to see those jars ?

Logs location :

The tomcat logs are in $CATALINA_HOME\logs\catalina.yyyy-mm-dd.log. Eclipse prints them in the console - if you want to have your console logged you must

In the servers tab, double-click on the Tomcat Server. You will get a screen called Overview. Click on "Open launch configuration". Click on the "Common" tab. Towards the bottom of the screen you can check the "File" checkbox and then specify a file that can be used to log your console (catalina.out) output. Finally, restart the Tomcat server.

like image 427
Mr_and_Mrs_D Avatar asked Oct 15 '12 22:10

Mr_and_Mrs_D


People also ask

How do I fix JSP compiler warning 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.

What is TLD in jar?

If you want to redistribute your tag files or implement your custom tags with tag handlers written in Java, you must declare the tags in a tag library descriptor (TLD). A tag library descriptor is an XML document that contains information about a library as a whole and about each tag contained in the library.

What is TLD scanning in Tomcat?

On startup, Tomcat recursively scans the WEB-INF directories for TLD (Tag Library Descriptor) files. As a result, if a webapp has a lot of files under that directory, it slows down the startup process.


1 Answers

If one wants to have the conf\logging.properties read one must (see also here) dump this file into the Servers\Tomcat v7.0 Server at localhost-config\ folder and then add the lines :

-Djava.util.logging.config.file="${workspace_loc}\Servers\Tomcat v7.0 Server at localhost-config\logging.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

to the VM arguments of the launch configuration one is using.

This may have taken a restart or two (or not) but finally I saw in the console in bright red :

FINE: No TLD files were found in [file:/C:/Dropbox/eclipse_workspaces/javaEE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ted2012/WEB-INF/lib/logback-classic-1.0.7.jar]. Consider adding the JAR to the tomcat.util.scan.DefaultJarScanner.jarsToSkip or org.apache.catalina.startup.TldConfig.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file. //etc

I still don't know when exactly this FINE warning appears - does not appear immediately on tomcat launch EDIT: from the comment by @Stephan: "The FINE warning appears each time any change is done in the JSP file".


Bonus: To make the warning go away add in catalina.properties :

# 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=logback-classic-1.0.7.jar,\ joda-time-2.1.jar,joda-time-2.1-javadoc.jar,mysql-connector-java-5.1.24-bin.jar,\ logback-core-1.0.7.jar,javax.servlet.jsp.jstl-api-1.2.1.jar 
like image 84
Mr_and_Mrs_D Avatar answered Oct 05 '22 12:10

Mr_and_Mrs_D