At least one JAR was scanned for TLDs yet contained no TLDs
Asked Answered
E

8

70

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.

Episcopal answered 15/10, 2012 at 22:37 Comment(5)
What's the full log line for the above log message? Include timestamp, logger, etc.Homeward
@Christopher : an eclipse issue probably - when I run the app manually I see the logs in the console that pops up when I hit startup.bat. Unable to locate the actual log files though - if you know where they are it would be great. Will post back once I figure this completely outEpiscopal
So much trouble with Eclipse, I am facing the same issue.Scrivings
For tomcat 9 see #40204624Conveyancing
I am getting the same error after I aded a filter to catalina>filters and ran the jar command with the following command jar cvf catalina.jar META-INF org module-info.classSedge
E
28

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
Episcopal answered 13/4, 2013 at 10:46 Comment(4)
The FINE warning appears each time any change is done in the JSP file.Samul
You can clean out tomcat (deleting the compiled JSPs) and the re-compilation will trigger the message. This catalina.properties setting isn't working for me - it's probably my tomcat version - 7.0.27 although the existing properties file already has tomcat..util.scan.DefaultJarScanner.jarsToSkip=x.y.zShavon
tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.jarImpletion
This explanation is most helpful together with @mhmuftee's answer detailing which logger to activate: org.apache.jasper.servlet.TldScanner.level = FINE (at least for Tomcat 8.x(?))Almeria
I
16

(tomcat 8.0.28) Above method did not work for me. This is what worked:

  1. Add this line to the end of your {CATALINA-HOME}/conf/logging.properties:

    org.apache.jasper.level = FINEST
    
  2. Shut down the server (if started).

  3. Open console and run (in case of Windows):

    %CATALINA_HOME%\bin\catalina.bat run
    
  4. Enjoy logs, e.g. (again, for Windows):

    {CATALINA-HOME}/logs/catalina.2015-12-28.log
    

I gave up on integrating this with Eclipse launch configuration so be aware that this works only from console, launching the server from Eclipse won't produce additional log messages.

Isobelisocheim answered 28/12, 2015 at 14:2 Comment(0)
C
9

apache-tomcat-8.0.33

If you want to enable debug logging in tomcat for TLD scanned jars then you have to change /conf/logging.properties file in tomcat directory.

uncomment the line :
org.apache.jasper.servlet.TldScanner.level = FINE

FINE level is for debug log.

This should work for normal tomcat.

If the tomcat is running under eclipse. Then you have to set the path of tomcat logging.properties in eclipse.

  1. Open servers view in eclipse.Stop the server.Double click your tomcat server.
    This will open Overview window for the server.
  2. Click on Open launch configuration.This will open another window.
  3. Go to the Arguments tab(second tab).Go to VM arguments section.
  4. paste this two line there :-
    -Djava.util.logging.config.file="{CATALINA_HOME}\conf\logging.properties"
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    Here CATALINA_HOME is your PC's corresponding tomcat server directory.
  5. Save the Changes.Restart the server.

Now the jar files that scanned for TLDs should show in the log.

Corell answered 20/5, 2016 at 5:12 Comment(1)
For Tomcat 9, I found this to be most helpful. The top response was unclear about the first step mentioned here. Also, use the specified property mentioned in the log for jarsToSkip, rather than those mentioned here.Thessalonian
E
4

(tomcat 7.0.32) I had problems to see debug messages althought was enabling TldLocationsCache row in tomcat/conf/logging.properties file. All I could see was a warning but not what libs were scanned. Changed every loglevel tried everything no luck. Then I went rogue debug mode (=remove one by one, clean install etc..) and finally found a reason.

My webapp had a customized tomcat/webapps/mywebapp/WEB-INF/classes/logging.properties file. I copied TldLocationsCache row to this file, finally I could see jars filenames.

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

Era answered 11/1, 2013 at 18:38 Comment(2)
@Episcopal - Try setting debug level to everything. I wrote a guide hereIncendiary
This is the correct answer for Tomcat 7, almost. Uncomment "org.apache.jasper.compiler.TldLocationsCache.level = FINE" in the logging.properties file. Then trash the compiled jsps in the /work folder. The messages are in the dated log file e.g. catalina.2018-09-26.logWing
G
2

For anyone trying to get this working using the Sysdeo Eclipse Tomcat plugin, try the following steps (I used Sysdeo Tomcat Plugin 3.3.0, Eclipse Kepler, and Tomcat 7.0.53 to construct these steps):

  1. Window --> Preferences --> Expand the Tomcat node in the tree --> JVM Settings
  2. Under "Append to JVM Parameters", click the "Add" button.
  3. In the "New Tomcat JVM parameter" popup, enter -Djava.util.logging.config.file="{TOMCAT_HOME}\conf\logging.properties", where {TOMCAT_HOME} is the path to your Tomcat directory (example: C:\Tomcat\apache-tomcat-7.0.53\conf\logging.properties). Click OK.
  4. Under "Append to JVM Parameters", click the "Add" button again.
  5. In the "New Tomcat JVM parameter" popup, enter -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager. Click OK.
  6. Click OK in the Preferences window.
  7. Make the adjustments to the {TOMCAT_HOME}\conf\logging.properties file as specified in the question above.
  8. The next time you start Tomcat in Eclipse, you should see the scanned .jars listed in the Eclipse Console instead of the "Enable debug logging for this logger" message. The information should also be logged in {TOMCAT_HOME}\logs\catalina.yyyy-mm-dd.log.
Gametophore answered 16/12, 2014 at 21:34 Comment(0)
A
0

My setup:

  • Eclipse 2022-06
  • embedded tomcat-server 8.5
  • log4j2
  • vaadin 23.2.3 (plain Spring MVC, without springboot)

To enable the JarScanner logging in log4j2:

  1. Define the log manager to be the log4j2 LogManager on the server's command line:

    -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager 
    
  2. include the needed log4j2 jars in the servers bootstrap classpath (section "User Entries"): log4j-api-*.jar, log4j-core-*.jar, log4-jul-*.jar

  3. include the resource path where the log4j configuration file is located into the servers bootstrap classpath (section "User Entries")

  4. define the logger level in your config file:

   <logger name="org.apache.jasper.servlet.TldScanner">
      <level value="TRACE" />
   </logger>

BTW: The TLD scanning is not needed at all in a vaadin project. See detailled discussions in this topic. For my setup only the edting of catalina.properties had the desired effect (means no TLD scanning is done at all):

  • jarsToSkip: add *.jar
  • jarsToScan: add flow-server-*.jar and vaadin-dev-server-*.jar

The both vaadin libraries must be scanned in order that tomcat finds the basic servlet configurations (concrete derivations of vaadin's AppShellConfigurator and VaadinMVCWebAppInitializer.

Additionally I have unchecked the "JavaServer Faces" Facet in the eclipse project's configuration (but I am not sure if this had the effect. After an eclipse restart this checkbox was activated again).

Antihero answered 11/1, 2023 at 14:39 Comment(0)
C
-1

For me I was getting the problem when deploying a geoserver WAR into tomcat 7

To fix it, I was on Java 7 and upgrading to Java 8.

This is running under a docker container. Tomcat 7.0.75 + Java 8 + Geos 2.10.2

Cost answered 15/3, 2017 at 0:24 Comment(1)
Well, I still see this line with Java 11.Ese
I
-2

I had the same issue. this is regarding the tomcat. I have resolved this issue by deleting the tomcat and the added tomcat. And it's working fine now.

Intuition answered 25/2, 2022 at 10:51 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Beaulahbeaulieu

© 2022 - 2024 — McMap. All rights reserved.