Solved

NoClassDefFoundException when running tomcat

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
commonTwo  challenge 63 120
count7 challenge 12 100
java set up 1 57
thymeleaf natural templating vs JSP 2 65
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 …
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.

929 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

11 Experts available now in Live!

Get 1:1 Help Now