Monday, October 03, 2011

Tomcat 7 TLD skipped ... is already defined

After deployment Tomcat 7 would log the below messages. Tomcat 6 did not:
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
Oct 3, 2011 11:45:44 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined

Solution

Look for duplicates in the server/project jars. In my case spring JSTL has a dependency of Spring standard and eliminating the second solves the problem (The second includes the same TLDs again)
<dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>com.springsource.javax.servlet.jsp.jstl</artifactId>
            <version>1.2.0</version>
            <exclusions>
             <exclusion>
              <artifactId>com.springsource.org.apache.taglibs.standard</artifactId>
              <groupId>org.apache.taglibs</groupId>
             </exclusion>
            </exclusions>
</dependency>

2 comments:

Sergio del Amo said...

I have the same issue in my logs while deploying several grails applications in tomcat 7. Where do you place the xml snippet you mention?

Nestor Urquiza said...

At the moment I do not use Grails so I think you will get better response if you ask in Grails mailing list/forums. At the end it uses Java of course and what is happening is that you have duplicated classes in your classpath however how to detect those I would know.
Best,
-Nestor

Followers