Unable to load class using jstl on Tomcat

Discussion in 'Java' started by David Zeidman, Aug 6, 2003.

  1. I am trying to use the core jstl in a jsp but I get the error message
    shown at the end of this message. I am using Win2000 and Tomcat 4.1

    The jsp starts off as follows:

    <%@page contentType="text/html"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

    <c:import url="/pageLogger.jsp"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>

    If I remove the import tag then it complains about an if tag lower
    down in the jsp so there is something wrong with the loading of the
    jstls. I have the c.tld file located in the <my webapp>\WEB-INF
    directory. I have the tld defined in my web.xml file as follows:

    <taglib>
    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
    </taglib>

    I have the jstl.jar file in the <my webapp>\WEB-INF\LIB directory.

    I have my java directory and the java bin directory in my path
    statement.

    Is there anything else I need to do or look at? Any suggestions would
    be great.

    Thanks

    David

    Error message follows:


    org.apache.jasper.JasperException: /login.jsp(3,0) Unable to load
    class import
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:219)
    at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:712)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:804)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
    at java.lang.Thread.run(Unknown Source)
    David Zeidman, Aug 6, 2003
    #1
    1. Advertising

  2. David Zeidman

    Wendy S Guest

    David Zeidman wrote:
    > I am trying to use the core jstl in a jsp but I get the error message
    > shown at the end of this message. I am using Win2000 and Tomcat 4.1
    > The jsp starts off as follows:
    > <%@page contentType="text/html"%>
    > <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    > <c:import url="/pageLogger.jsp"/>
    > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    > If I remove the import tag then it complains about an if tag lower
    > down in the jsp so there is something wrong with the loading of the
    > jstls. I have the c.tld file located in the <my webapp>\WEB-INF
    > directory. I have the tld defined in my web.xml file as follows:
    > <taglib>
    > <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    > <taglib-location>/WEB-INF/c.tld</taglib-location>
    > </taglib>


    You shouldn't need this part. Tomcat will locate the tld in one of the .jar
    files.

    > I have the jstl.jar file in the <my webapp>\WEB-INF\LIB directory.


    should be WEB-INF\lib, although the backwards slashes say you're using
    Windows so case may not be an issue.

    Are you sure you've got all the .jar files? What about 'standard.jar'? I
    have both jstl.jar and standard.jar in my WEB-INF/lib directory with a
    working Struts/JSTL webapp.

    Another question, whose Standard taglib implementation are you using?
    Jakarta's version is good, I have heard of problems with one other
    implementation, I think it was Resin's.

    --
    Wendy in Chandler, AZ
    Wendy S, Aug 7, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shahbaz
    Replies:
    0
    Views:
    889
    shahbaz
    Oct 27, 2003
  2. Robert Mark Bram

    Custom JSTL that accepts JSTL expression

    Robert Mark Bram, Dec 15, 2004, in forum: Java
    Replies:
    0
    Views:
    954
    Robert Mark Bram
    Dec 15, 2004
  3. Replies:
    0
    Views:
    5,466
  4. Replies:
    2
    Views:
    580
  5. DaFoot
    Replies:
    1
    Views:
    1,670
    DaFoot
    Oct 23, 2008
Loading...

Share This Page