Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 20104D780 for ; Fri, 10 Aug 2012 14:40:54 +0000 (UTC) Received: (qmail 34933 invoked by uid 500); 10 Aug 2012 14:40:50 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 34878 invoked by uid 500); 10 Aug 2012 14:40:50 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 34869 invoked by uid 99); 10 Aug 2012 14:40:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2012 14:40:50 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [76.96.27.243] (HELO qmta13.emeryville.ca.mail.comcast.net) (76.96.27.243) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2012 14:40:44 +0000 Received: from omta18.emeryville.ca.mail.comcast.net ([76.96.30.74]) by qmta13.emeryville.ca.mail.comcast.net with comcast id l0fC1j0011bwxycAD2gQQD; Fri, 10 Aug 2012 14:40:24 +0000 Received: from Christophers-MacBook-Pro.local ([98.226.18.8]) by omta18.emeryville.ca.mail.comcast.net with comcast id l2gM1j0120AT6Uq8e2gPfr; Fri, 10 Aug 2012 14:40:24 +0000 Message-ID: <50251D57.10701@christopherschultz.net> Date: Fri, 10 Aug 2012 10:40:23 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: ClassCastException org.apache.jasper.runtime.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl References: <12552501.130.1344256661440.JavaMail.daniel@cleveland> <5020DDFA.2050405@apache.org> <0ab14cfb-b8c4-4541-b242-5c27686bac80@email.android.com> <50268fbc-1a5c-4980-a539-c8d6ff0d77c4@email.android.com> <5024CF22.7000808@apache.org> In-Reply-To: <5024CF22.7000808@apache.org> X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mark, On 8/10/12 5:06 AM, Mark Thomas wrote: > On 10/08/2012 04:57, Dale Ogilvie wrote: >> -----Original Message----- From: Mark Thomas >> [mailto:markt@apache.org] Sent: Thursday, 9 August 2012 8:22 >> p.m. To: Tomcat Users List Subject: RE: ClassCastException >> org.apache.jasper.runtime.ELContextImpl cannot be cast to >> org.apache.jasper.el.ELContextImpl >> >>>> Dale Ogilvie wrote: >>>> >>>> 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. So your statement that "Tomcat >>>> prevents a class loaded in app2 from being visible in app1" >>>> seems to be false. >> >>> Does that cast succeed? No. Why? Because the class isn't >>> visible to app1. >> >> Thanks again for your explanations here Mark. Apologies if you >> thought I was calling your credentials into question. Nothing of >> any sort entered into my mind. >> >> Trying not to be annoying, just to gain clarity. I'll rephrase >> your comment above for clarity of what I believe you are saying. >> >> "Does that cast of the org.apache.jasper.runtime.ELContextImpl >> instance succeed? No. Why? Because the >> org.apache.jasper.runtime.ELContextImpl class isn't visible to >> app1." >> >> If app1 has an instance of >> org.apache.jasper.runtime.ELContextImpl (provided by app2) whose >> class it knows nothing about, shouldn't the exception be: >> >> ClassNotFoundException org.apache.jasper.runtime.ELContextImpl >> >> NOT >> >> ClassCastException org.apache.jasper.runtime.ELContextImpl cannot >> be cast to org.apache.jasper.el.ELContextImpl >> >> The latter error does not tell me that the class >> org.apache.jasper.runtime.ELContextImpl isn't visible to app1. > > It will depend exactly what is going on but since it is a cast > that fails, ClassCastException doesn't seem to be unreasonable. > There may be a root cause that provides more detail. The full > exception should be in the logs. Actually, I would have expected the ClassCastException because the JVM is not trying to load a class at this point: the Class was loaded long before through some unrelated mechanism. When this failure occurs, the Class has been loaded and an object has already been created: the JVM is just checking a cast which (of course) fails. Dave, if this is reproducable, you ought to be able to catch it with a debugger and go and look at all the interesting details such as which ClassLoader loaded which class, what the exact type (Class + ClassLoader) of the object in question is, and exactly what type (Class + ClassLoader) is being used for the cast. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAlHVcACgkQ9CaO5/Lv0PDdCQCgh08W+lt8fppRiEpahGXF1pRY MAsAn2YpMDkFjJ4Ll/EKiOuOEoaz2UEK =eQxK -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org