eclipse 至少扫描了一个 JAR 以查找 TLD 但不包含任何 TLD

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12905001/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 21:22:38  来源:igfitidea点击:

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

eclipsetomcattomcat7

提问by Mr_and_Mrs_D

I keep getting this on tomcat 7.30 (eclipse juno)

我一直在 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.

至少对一个 JAR 进行了 TLD 扫描,但不包含 TLD。为该记录器启用调试日志记录以获取已扫描但未在其中找到 TLD 的完整 JAR 列表。在扫描期间跳过不需要的 JAR 可以缩短启动时间和 JSP 编译时间。

Well I went at conf\logging.propertiesand turned all INFOto FINEand uncommented the line

好吧,我去了,conf\logging.properties然后全部INFO转向FINE并取消注释该行

# 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...

我仍然看到 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

tomcat 日志位于 $CATALINA_HOME\logs\catalina.yyyy-mm-dd.log 中。Eclipse 在控制台中打印它们 - 如果您想记录的控制台,您必须

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.

在服务器选项卡中,双击 Tomcat 服务器。您将看到一个名为概览的屏幕。单击“打开启动配置”。单击“通用”选项卡。在屏幕底部,您可以选中“文件”复选框,然后指定一个可用于记录控制台 (catalina.out) 输出的文件。最后,重启Tomcat服务器。

采纳答案by Mr_and_Mrs_D

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

如果想要conf\logging.properties读取,则必须(另请参见此处)将此文件转储到文件Servers\Tomcat v7.0 Server at localhost-config\夹中,然后添加以下行:

-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

-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 configurationone is using.

到正在使用的启动配置的 VM 参数。

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

FINE:在 [file:/C:/Dropbox/eclipse_workspaces/javaEE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ted2012/WEB-INF/lib/logback 中找不到 TLD 文件-classic-1.0.7.jar]。考虑将 JAR 添加到 CATALINA_BASE/conf/catalina.properties 文件中的 tomcat.util.scan.DefaultJarScanner.jarsToSkip 或 org.apache.catalina.startup.TldConfig.jarsToSkip 属性。//等等

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

我仍然不知道这个FINE警告究竟何时出现 - 在 tomcat 启动时不会立即出现编辑:来自@Stephan 的评论:“每次在 JSP 文件中进行任何更改时都会出现 FINE 警告”



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

奖励:要使警告消失,请添加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

回答by dominik

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

(tomcat 8.0.28)以上方法对我不起作用。这是有效的:

  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
    
  1. 将此行添加到 {CATALINA-HOME}/conf/logging.properties 的末尾:

    org.apache.jasper.level = FINEST
    
  2. 关闭服务器(如果已启动)。

  3. 打开控制台并运行(在 Windows 的情况下):

    %CATALINA_HOME%\bin\catalina.bat run
    
  4. 享受日志,例如(同样适用于 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.

我放弃了将其与 Eclipse 启动配置集成,因此请注意,这仅适用于控制台,从 Eclipse 启动服务器不会产生额外的日志消息。

回答by mhmuftee

apache-tomcat-8.0.33

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.

如果要在 tomcat 中为 TLD 扫描的 jar 启用调试日志记录,则必须更改 tomcat 目录中的 /conf/logging.properties 文件。

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

取消注释行:
org.apache.jasper.servlet.TldScanner.level = FINE

FINElevel is for debug log.

FINE级别用于调试日志。

This should work for normal tomcat.

这应该适用于普通的 tomcat。

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

如果tomcat是在eclipse下运行的。然后你要在eclipse中设置tomcat logging.properties的路径。

  1. Open serversview in eclipse.Stop the server.Double click your tomcat server.
    This will open Overviewwindow for the server.
  2. Click on Open launch configuration.This will open another window.
  3. Go to the Argumentstab(second tab).Go to VM argumentssection.
  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_HOMEis your PC's corresponding tomcat server directory.
  5. Save the Changes.Restart the server.
  1. 在 Eclipse 中打开服务器视图。停止服务器。双击您的 tomcat 服务器。
    这将打开服务器的概览窗口。
  2. 单击打开启动配置。这将打开另一个窗口。
  3. 转到参数选项卡(第二个选项卡)。转到VM 参数部分。
  4. 将这两行粘贴到那里:-
    -Djava.util.logging.config.file="{CATALINA_HOME}\conf\logging.properties"
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    这里CATALINA_HOME是您的 PC对应的tomcat服务器目录。
  5. 保存更改。重新启动服务器。

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

现在,扫描 TLD 的 jar 文件应显示在日志中。

回答by Whome

(tomcat 7.0.32)I had problems to see debug messages althought was enabling TldLocationsCache row in tomcat/conf/logging.propertiesfile. 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.

(tomcat 7.0.32)尽管在tomcat/conf/logging.properties文件中启用了 TldLocationsCache 行,但我在查看调试消息时遇到了问题。我能看到的只是一个警告,而不是扫描了哪些库。改变了每个日志级别都尝试了一切都没有运气。然后我进入了流氓调试模式(=一一删除,全新安装等),终于找到了原因。

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

我的 webapp 有一个自定义的tomcat/webapps/mywebapp/WEB-INF/classes/logging.properties文件。我将 TldLocationsCache 行复制到这个文件中,最后我可以看到 jars 文件名。

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

# 要查看 TldLocationsCache 中的调试消息,请取消注释以下行:org.apache.jasper.compiler.TldLocationsCache.level = FINE

回答by GoldDragonTSU

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):

对于尝试使用Sysdeo Eclipse Tomcat 插件实现此功能的任何人,请尝试以下步骤(我使用 Sysdeo Tomcat 插件 3.3.0、Eclipse Kepler 和 Tomcat 7.0.53 来构建这些步骤):

  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.propertiesfile 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.
  1. 窗口--> 首选项--> 展开树中的Tomcat 节点--> JVM 设置
  2. 在“附加到 JVM 参数”下,单击“添加”按钮。
  3. 在“New Tomcat JVM 参数”弹出窗口中,输入-Djava.util.logging.config.file="{TOMCAT_HOME}\conf\logging.properties",其中{TOMCAT_HOME}是 Tomcat 目录的路径(例如:C:\Tomcat\apache-tomcat-7.0.53\conf\logging.properties)。单击确定。
  4. 在“附加到 JVM 参数”下,再次单击“添加”按钮。
  5. 在“New Tomcat JVM 参数”弹出窗口中,输入-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager. 单击确定。
  6. 在首选项窗口中单击确定。
  7. {TOMCAT_HOME}\conf\logging.properties按照上述问题中的说明对文件进行调整。
  8. 下次在 Eclipse 中启动 Tomcat 时,您应该会看到 Eclipse 控制台中列出的扫描的 .jar,而不是“为此记录器启用调试日志记录”消息。该信息也应登录{TOMCAT_HOME}\logs\catalina.yyyy-mm-dd.log

回答by wired00

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

对我来说,我在将 a 部署geoserver WAR到 tomcat 7时遇到了问题

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

为了修复它,我使用的是 Java 7 并升级到 Java 8。

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

这是在 docker 容器下运行的。Tomcat 7.0.75+ Java 8+Geos 2.10.2