Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » ClassCastException for JSP expression language(Cannot use jsp EL when running project with tomcat 7 (tomcat 6 ok))
icon5.gif  ClassCastException for JSP expression language [message #754138] Tue, 01 November 2011 02:11 Go to next message
warhen  is currently offline warhen Friend
Messages: 4
Registered: November 2011
Junior Member
Hi, I am running the following version of eclipse:

Eclipse Java EE IDE for Web Developers.
Version: Indigo Service Release 1
Build id: 20110916-0149

I am seeing an issue that should be easy to reproduce because it happens after creating a new "Dynamic Web Project" without adding on any project natures or additional libraries.
All you need is to have the following two versions of tomcat installed:
- tomcat version 6 (I have 6.0.20)
- tomcat version 7 (I have 7.0.22)

Once the project is created, I put an index.jsp file in the "WebContent" directory.
The content of index.jsp is:


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

${header["user-agent"]}


1) Run As --> Run on Server --> Tomcat v6.0 at localhost
Everything works (I get a webpage that shows what browser is being used).

2) Run As --> Run on Server --> Tomcat v7.0 at localhost
I get the following exception:

org.apache.jasper.JasperException: java.lang.ClassCastException: org.apache.jasper.runtime.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:548)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:471)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

java.lang.ClassCastException: org.apache.jasper.runtime.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl
	org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:982)
	org.apache.jsp.index_jsp._jspService(index_jsp.java:64)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


I can find "org.apache.jasper.el.ELContextImpl" in the jasper.jar in the tomcat lib folder. However, I don't know where "org.apache.jasper.runtime.ELContextImpl" originates.
I have surfed the web a bit to find clues and the most I've been able to find is the notion that this sort of thing could be due to two separate class loaders clashing.

I can only guess at this point. All I know is that the simplest jsp page will work until you put any jsp expression in it, like ${myVar}.

It would be a relief if anyone has seen this or suspects where I messed up.

Thanks,

Warhen
Re: ClassCastException for JSP expression language [message #754147 is a reply to message #754138] Tue, 01 November 2011 04:23 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4065
Registered: July 2009
Senior Member

How is Tomcat installed? Looks like you might have the two mixed up or together somehow.

Nitin Dahyabhai
Eclipse Web Tools Platform
Re: ClassCastException for JSP expression language [message #754224 is a reply to message #754138] Tue, 01 November 2011 13:48 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 31-Oct-11 20:11, warhen wrote:
> Hi, I am running the following version of eclipse:
>
> Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>
> I am seeing an issue that should be easy to reproduce because it happens
> after creating a new "Dynamic Web Project" without adding on any project
> natures or additional libraries.
> [snip]

You'll get more and better help in the Eclipse web tool project forum.
Re: ClassCastException for JSP expression language [message #754266 is a reply to message #754138] Tue, 01 November 2011 17:08 Go to previous message
warhen  is currently offline warhen Friend
Messages: 4
Registered: November 2011
Junior Member
Ok, I have moved the topic as suggested.

Thanks.
Previous Topic:SVN Operations freezing Eclipse
Next Topic:Trouble Intalling AWS EC2 plugin on eclipse
Goto Forum:
  


Current Time: Mon Jun 21 02:17:26 GMT 2021

Powered by FUDForum. Page generated in 0.03382 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top