2012-01-04 177 views
14

当在Eclipse 运行我的JSF 2应用程序我得到的是TLD跳过如下因为它已经定义了几种信息日志:什么是“INFO:TLD跳过,URI已经定义”是什么意思?

Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://www.springframework.org/tags/form is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined 

我很想知道,是什么数平均?

+0

请不要转发您的问题。 – NullUserException 2012-01-06 02:55:09

+2

链接的重复帖子已被删除 – 2013-03-19 09:38:34

回答

11

这意味着您的webapp的运行时类路径中有TLD文件重复。由于TLD通常包含在库JAR文件中,因此这意味着您的webapp的运行时类路径中存在重复的JAR文件。

假设您尚未触及应用服务器的/lib文件夹或JDK的/lib文件夹,那么这些重复项位于WAR构建的/WEB-INF/lib文件夹中。清理它。通过规范所要求的URI

3

优先顺序是:

J2EE platform taglibs - Tomcat doesn't provide these 

web.xml entries 

JARS in WEB-INF/lib & TLDs under WEB-INF (equal priority) 

Additional entries from the container 

Tomcat的负载TLD两次。

1,当Tomcat启动时,它加载tld以在tld文件中查找侦听器。

2,当第一个jsp文件被编译时,它构建一个tld对的缓存。

1,负载TLD找到听众在TLD文件

当从web.xml文件加载,提出的taglib-URI从web.xml和URI从TLD文件转换为一组。 从WEB-INF或jar加载时,uri来自tld文件。

Tomcat需要避免重复的tld侦听器添加,因此它会检查uri是否存在于集合中。如果uri已经存在,那么会记录您发布的消息并跳过添加tld侦听器。

2,建立缓存

1)web.xml中的条目,标签URI是从web.xml中得到了在WEB-INF

2)扫描TLD文件,标签URI是从有tld文件

3)扫描瓶,标签uri是从tld文件中获得的。

如果uri存在,则该条目将被忽略。

0

这意味着,例如,如果您使用的是Tomcat和Maven(或其他服务器),而您运送的是已在服务器上找到的JSTL库并且该服务器确实抱怨。

<dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>jstl</artifactId> 
     <version>1.2</version> 
    </dependency> 

在你的应用程序部署(在Tomcat)的时候,那么你得到的错误信息:

INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined 
Mar 02, 2017 2:19:32 PM org.apache.catalina.startup.TaglibUriRule body 

的解决方案是使用标签“范围”和“提供”的价值,因为JSTL已经与Tomcat一起发货(仅限于您的IDE):

<dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>jstl</artifactId> 
     <version>1.2</version> 
     <scope>provided</scope> 
    </dependency> 

然后错误将会消失。