Solved

NoClassDefFoundException when running tomcat

Posted on 2006-06-29
2
2,604 Views
Last Modified: 2013-11-24
Hello,

I'm trying to set up a web-based reporting module and I can't seem to get certain parts of JSPs to work with Tomcat.  I'm running 5.0.27 on Linux, and I'm using Enterprise Java Beans in Eclipse for coding and running the server (Got the server running fine in Eclipse and standalone.)  Whenever I try to run the following ...

<%@ page prefix="c" uri="http://java.sun.com/jstl/core">
....
<jsp:useBean id="ifaceBean" scope="session" class="...WebInterfaceBean"/>

...
<c:forEach var="colour" items="${ifaceBean.themeColours}">
       ...
</c:forEach>

... I get the following exception from Tomcat:

exception

javax.servlet.ServletException: javax/el/ValueExpression
      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
      org.apache.jsp.index_jsp._jspService(index_jsp.java:174)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NoClassDefFoundError: javax/el/ValueExpression
      org.apache.taglibs.standard.tag.common.core.ForEachSupport.prepare(ForEachSupport.java:149)
      javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(Unknown Source)
      org.apache.jsp.index_jsp._jspx_meth_c_forEach_0(index_jsp.java:193)
      org.apache.jsp.index_jsp._jspService(index_jsp.java:88)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Here's the weird thing: I can use other core JSTL tags just fine, ie c:url, c:set ....etc, but whenever I try to use forEach I get this message.  Given the amount of repetitive stuff I have to code,  it's going to just kill me to not be able to use looping structures.   Has anybody had any prior experience with this?  I know my CLASSPATH is set up correctly, I have jstl.jar and standard.jar in $CATALINA_HOME/common/lib and in my $PROJECT_ROOT/WEB-INF/lib folders, as well as their dependendcies for JDBC, JAXP, etc.  I'm getting very desperate here.  Can somebody please help ?

Alex Marshall
0
Comment
Question by:alexmarshall
2 Comments
 
LVL 27

Accepted Solution

by:
rrz earned 125 total points
ID: 17014906
I am making a guess here. I don't use EJBs or Eclipse. So go easy on me. I saw this page  
http://java.sun.com/products/jsp/2.1/docs/jsp-2_1-pfd2/javax/el/ValueExpression.html  
It says that ValueExpression is for JSP 2.1 . So it is probably part of the new unified EL. You should be using JSP 2.0  since you posted
>I'm running 5.0.27    
I suspect you  have the wrong jars.  Which distribution did you download ?   Try using JSTL 1.1.2
http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html  
>I have jstl.jar and standard.jar in $CATALINA_HOME/common/lib and in my $PROJECT_ROOT/WEB-INF/lib folders,  
I would just put them in common/lib.   Take them out of your web app.  
0
 

Author Comment

by:alexmarshall
ID: 17017622
Thank you for your comment.  I really appreciate that somebody at least tried to answer.  Unfortunately, being me, I obsessed over it in the wee hours of the night and found out that, oddly enough, deleting a couple of jars from my $CATALINA_BASE/common/lib folder fixed it.  I got it working on my home box and then just compared it to everything on my work box.  Turned out that deleting appserv-jstl.jar and j2ee.jar from my work box fixed the problem on my work box.  Still don't know why though.  I'll give you the points anyway.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now