Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

NoClassDefFoundException when running tomcat

Posted on 2006-06-29
2
2,611 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
array11 challenge 16 72
array220 challenge 8 65
java 8 lambda expresssions exception handling 3 101
ForLoop Example 3 53
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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.

828 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