Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Unable to load class using jstl on Tomcat

Reply
Thread Tools

Unable to load class using jstl on Tomcat

 
 
David Zeidman
Guest
Posts: n/a
 
      08-06-2003
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.jsp Error(DefaultErrorHandler.java:94)
at org.apache.jasper.compiler.ErrorDispatcher.dispatc h(ErrorDispatcher.java:42
at org.apache.jasper.compiler.ErrorDispatcher.jspErro r(ErrorDispatcher.java:219)
at org.apache.jasper.compiler.Parser.parseCustomTag(P arser.java:712)
at org.apache.jasper.compiler.Parser.parseElements(Pa rser.java:804)
at org.apache.jasper.compiler.Parser.parse(Parser.jav a: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(C ompiler.java:227)
at org.apache.jasper.compiler.Compiler.compile(Compil er.java:369)
at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:473)
at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Unknown Source)
 
Reply With Quote
 
 
 
 
Wendy S
Guest
Posts: n/a
 
      08-07-2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(struts/JSTL) Setting bean property value with jstl choose compoundresults DaFoot Java 1 10-23-2008 12:42 PM
JSTL version Tomcat vs Resin - Unable to find setter method - set(Object) kebabkongen@hotmail.com Java 2 11-14-2006 11:42 AM
Tomcat error-Could not load Tomcat server configuration sjoshi Java 0 09-27-2005 06:47 PM
Custom JSTL that accepts JSTL expression Robert Mark Bram Java 0 12-15-2004 12:26 AM
using param or out tag inside sql tag (jsp/jstl/tomcat) shahbaz Java 0 10-27-2003 02:46 AM



Advertisments