Return-Path: Delivered-To: apmail-incubator-sling-commits-archive@locus.apache.org Received: (qmail 41623 invoked from network); 11 Feb 2008 09:50:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Feb 2008 09:50:46 -0000 Received: (qmail 10761 invoked by uid 500); 11 Feb 2008 09:50:40 -0000 Delivered-To: apmail-incubator-sling-commits-archive@incubator.apache.org Received: (qmail 10724 invoked by uid 500); 11 Feb 2008 09:50:40 -0000 Mailing-List: contact sling-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sling-dev@incubator.apache.org Delivered-To: mailing list sling-commits@incubator.apache.org Received: (qmail 10715 invoked by uid 99); 11 Feb 2008 09:50:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2008 01:50:40 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2008 09:50:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BEE431A9832; Mon, 11 Feb 2008 01:50:22 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r620446 - /incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java Date: Mon, 11 Feb 2008 09:50:22 -0000 To: sling-commits@incubator.apache.org From: fmeschbe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080211095022.BEE431A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fmeschbe Date: Mon Feb 11 01:50:20 2008 New Revision: 620446 URL: http://svn.apache.org/viewvc?rev=620446&view=rev Log: Remove JspApplicationContextImpl from the servlet context when the JspScriptEngineFactory is deactivated. Otherwise a ClassCastException may be caused after this factory is recreated because the class loader of the JspApplicationContextImpl class object is different from the one stored in the servlet context Modified: incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java Modified: incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java?rev=620446&r1=620445&r2=620446&view=diff ============================================================================== --- incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java (original) +++ incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java Mon Feb 11 01:50:20 2008 @@ -40,13 +40,14 @@ import org.apache.sling.scripting.jsp.jasper.JasperException; import org.apache.sling.scripting.jsp.jasper.Options; import org.apache.sling.scripting.jsp.jasper.compiler.JspRuntimeContext; +import org.apache.sling.scripting.jsp.jasper.runtime.JspApplicationContextImpl; import org.osgi.service.component.ComponentContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The JSP engine (a.k.a Jasper). - * + * * @scr.component scr="no" label="%jsphandler.name" * description="%jsphandler.description" * @scr.property name="service.description" value="JSP Script Handler" @@ -231,6 +232,12 @@ ioProvider = null; componentContext = null; + + // remove JspApplicationContextImpl from the servlet context, otherwise + // a ClassCastException may be caused after this component is recreated + // because the class loader of the JspApplicationContextImpl class + // object is different from the one stored in the servlet context + slingServletContext.removeAttribute(JspApplicationContextImpl.class.getName()); } protected void bindRepositoryClassLoaderProvider(