tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: ClassCastException org.apache.jasper.runtime.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl
Date Thu, 09 Aug 2012 04:12:10 GMT
> From: Dale Ogilvie [mailto:Dale_Ogilvie@trimble.com] 
> Subject: RE: ClassCastException org.apache.jasper.runtime.ELContextImpl 
> cannot be cast to org.apache.jasper.el.ELContextImpl

> That says to me that app1 already has an instance of 
> org.apache.jasper.runtime.ELContextImpl which it is 
> trying to cast to the tomcat version.

No, that's not what's going on.  A class extending the abstract class ELContext is typically
supplied *only* by the servlet container, not by any webapp.  Since you have included it in
app2 (inadvertently or not), it has superseded the one included with Tomcat, which would normally
be loaded with a shared classloader, as part of the Jasper environment.  When app1 is referenced
later, Jasper encounters an error because its expected ELContextImpl can't be accessed.

> So your statement that "Tomcat prevents a class loaded in app2 from being 
> visible in app1" seems to be false.

Nope, that's exactly what's going on.  Your ELContextImpl class in app2 has disrupted Jasper
being able to process expression language constructs in app1, as Mark stated.

What Tomcat might be able to do is prevent use of any webapp classes extending ELContext,
but I haven't looked to see how hard that would be, or if the spec allows such a restriction.
 The proper thing to do is not build a webapp that doesn't play well with others.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message