Results 1 to 6 of 6

Thread: Unable to read TLD for Step-By-Step application

  1. #1
    Join Date
    Dec 2004
    Location
    Asheville, NC
    Posts
    82

    Default Unable to read TLD for Step-By-Step application

    I'm trying to get the Spring framework step-by-step application to work and I am having trouble with the tag libraries included in the include.jsp. It appears that Tomcat is having trouble finding a TLD which should be found in standard.jar (which is present in webapps/springapp/WEB-INF/lib). Below is the exception I see from Tomcat when I call hello.htm:


    Code:
    org.apache.jasper.JasperException: /WEB-INF/jsp/hello.jsp(1,1) Unable to read TLD "META-INF/c-1_0.tld" from JAR file "file:/C:/jakarta-tomcat-5.5.4/webapps/springapp/WEB-INF/lib/standard.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
    	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
    	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86)
    	org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:339)
    	org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:372)
    
    etc...

    Any ideas as to what I've done wrong, or what I might do to make things right ? I am using Tomcat 5.5.4, Windows XP, Spring Framework 1.1.2.

    Thanks in advance for your help with this.


    --James

  2. #2
    Join Date
    Dec 2004
    Location
    Asheville, NC
    Posts
    82

    Default

    I resolved this issue with the following web.xml taglib entries, which map to the actual TLD files instead of the JAR:

    Code:
        <taglib>
            <taglib-uri>http&#58;//java.sun.com/jstl/core</taglib-uri>
            <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
        </taglib>
    
        <taglib>
            <taglib-uri>http&#58;//java.sun.com/jstl/fmt</taglib-uri>
            <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
        </taglib>
    and corresponding entries in the include.jsp

    Code:
    <%@ taglib uri="http&#58;//java.sun.com/jstl/core" prefix="c"%>
    <%@ taglib uri="http&#58;//java.sun.com/jstl/fmt" prefix="fmt"%>
    Now unfortunately I am having trouble with getting a class to load:

    Code:
    org.apache.jasper.JasperException&#58; /hello.jsp&#40;1,1&#41; Failed to load or instantiate TagLibraryValidator class&#58; org.apache.taglibs.standard.tlv.JstlCoreTLV
    	org.apache.jasper.compiler.DefaultErrorHandler.jspError&#40;DefaultErrorHandler.java&#58;39&#41;
    	org.apache.jasper.compiler.ErrorDispatcher.dispatch&#40;ErrorDispatcher.java&#58;405&#41;
    	org.apache.jasper.compiler.ErrorDispatcher.jspError&#40;ErrorDispatcher.java&#58;86&#41;
    	org.apache.jasper.compiler.Parser.processIncludeDirective&#40;Parser.java&#58;339&#41;
    	org.apache.jasper.compiler.Parser.parseIncludeDirective&#40;Parser.java&#58;372&#41;
    	org.apache.jasper.compiler.Parser.parseDirective&#40;Parser.java&#58;475&#41;
    	org.apache.jasper.compiler.Parser.parseElements&#40;Parser.java&#58;1539&#41;
    	org.apache.jasper.compiler.Parser.parse&#40;Parser.java&#58;126&#41;
    	org.apache.jasper.compiler.ParserController.doParse&#40;ParserController.java&#58;211&#41;
    	org.apache.jasper.compiler.ParserController.parse&#40;ParserController.java&#58;100&#41;
    	org.apache.jasper.compiler.Compiler.generateJava&#40;Compiler.java&#58;146&#41;
    	org.apache.jasper.compiler.Compiler.compile&#40;Compiler.java&#58;286&#41;
    	org.apache.jasper.compiler.Compiler.compile&#40;Compiler.java&#58;267&#41;
    	org.apache.jasper.compiler.Compiler.compile&#40;Compiler.java&#58;255&#41;
    	org.apache.jasper.JspCompilationContext.compile&#40;JspCompilationContext.java&#58;556&#41;
    	org.apache.jasper.servlet.JspServletWrapper.service&#40;JspServletWrapper.java&#58;296&#41;
    	org.apache.jasper.servlet.JspServlet.serviceJspFile&#40;JspServlet.java&#58;295&#41;
    	org.apache.jasper.servlet.JspServlet.service&#40;JspServlet.java&#58;245&#41;
    	javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;802&#41;

    Any ideas as to how I can get around this, or what might be causing the problem ?


    --James

  3. #3
    Join Date
    Dec 2004
    Location
    Asheville, NC
    Posts
    82

    Default

    This is no longer an issue now that I have deployed the application using JBoss 3.2.5 instead of Tomcat 5.5.4. It seems that JBoss is better at finding classes than Tomcat ? Strange since JBoss runs a version of Tomcat under the covers.

    --James

  4. #4
    Join Date
    Aug 2004
    Location
    Toronto, ON, Canada
    Posts
    101

    Default

    What version of Jakarta Taglibs Standard are you using?

    S.

  5. #5
    Join Date
    Dec 2004
    Location
    Asheville, NC
    Posts
    82

    Default

    I think the standard.jar and jstl.jar were taken from a WEB-INF/lib of one of the Tomcat 5.5.4 example web applications.

    --James

  6. #6
    Join Date
    Aug 2004
    Location
    Toronto, ON, Canada
    Posts
    101

    Default

    You need to know for sure because the URIs of the TLDs are different for the 1.0 and 1.1 version. I'm guessing it is the 1.1 version so you should probably reference the core tags like this instead:

    Code:
    <%@ taglib prefix="c" uri="http&#58;//java.sun.com/jsp/jstl/core" %>
    Also, there is no need to reference the TLDs directly from your web.xml. With Tomcat 5.0 and higher it automatically scans all jars included for tld files. That is a requirement for Servlet 2.4 compatible containers. (Be sure to use a 2.4 compatible web.xml though)

    S.

Similar Threads

  1. Beandoc crashing (on its samples!)
    By aaime in forum Container
    Replies: 17
    Last Post: Oct 7th, 2005, 07:21 AM
  2. Replies: 4
    Last Post: May 22nd, 2005, 06:48 PM
  3. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  4. Replies: 1
    Last Post: Mar 31st, 2005, 01:50 PM
  5. Questioning the core component
    By Martin Kersten in forum Swing
    Replies: 6
    Last Post: Feb 21st, 2005, 03:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •