What does "INFO: TLD skipped. URI is already defined" mean?

23,281

Solution 1

This means that you have duplicate TLD files in your webapp's runtime classpath. As TLDs are normally contained in the library JAR files, this in turn means that you have duplicate JAR files in your webapp's runtime classpath.

Assuming that you haven't touched appserver's /lib folder nor the JDK's /lib folders, then those duplicates are in the /WEB-INF/lib folder of the WAR build. Cleanup it.

Solution 2

Priority order of URIs required by spec is:

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 loads tld twice.

1, when Tomcat starts up, it loads tld to find listeners in tld files.

2, when first jsp file is compiled, it build a cache of tld pairs.

1, load tld to find listeners in tld files

When loading from web.xml, it puts taglib-uri from web.xml and uri from tld file into a set. When loading from WEB-INF or jar, the uri is from tld file.

Tomcat needs to avoid duplicate tld listener adding, so it checks whether uri exists in the set. If uri already exists, it logs the messages you post and skip adding tld listener.

2, build cache

1) web.xml entries, the tag uri is got from web.xml

2) scan tld files under WEB-INF, the tag uri is got from tld files

3) scan jars, the tag uri is got from tld files.

If uri aready exists, the entry will be ignored.

Solution 3

It means for example if you use Tomcat and Maven (or others servers) that you ship a JSTL library that is already found on the server and the server does complain.

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

At the time you application is deployed (on Tomcat) then you get the error message:

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

The solution is to use the tag 'scope' and a value of 'provided' because JSTL is already shipped with Tomcat (it is only for your IDE):

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

Then the error will disappear.

Share:
23,281
Sameh Farahat
Author by

Sameh Farahat

Updated on March 03, 2020

Comments

  • Sameh Farahat
    Sameh Farahat over 4 years

    When running my JSF 2 application in eclipse I am getting several info logs that TLD was skipped because it's already defined as follows:

    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
    

    I am curious to know, what does this log mean?