Return-Path: Delivered-To: apmail-jakarta-velocity-dev-archive@www.apache.org Received: (qmail 5299 invoked from network); 4 Jan 2006 05:44:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Jan 2006 05:44:38 -0000 Received: (qmail 78757 invoked by uid 500); 4 Jan 2006 05:44:24 -0000 Delivered-To: apmail-jakarta-velocity-dev-archive@jakarta.apache.org Received: (qmail 78677 invoked by uid 500); 4 Jan 2006 05:44:23 -0000 Mailing-List: contact velocity-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Velocity Developers List" Reply-To: "Velocity Developers List" Delivered-To: mailing list velocity-dev@jakarta.apache.org Received: (qmail 78634 invoked by uid 99); 4 Jan 2006 05:44:23 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jan 2006 21:44:23 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id D3B49DE for ; Wed, 4 Jan 2006 06:44:01 +0100 (CET) Message-ID: <1885972963.1136353441082.JavaMail.jira@ajax.apache.org> Date: Wed, 4 Jan 2006 06:44:00 +0100 (CET) From: "Will Glass-Husain (JIRA)" To: velocity-dev@jakarta.apache.org Subject: [jira] Commented: (VELOCITY-98) #parse / #include causing ClassCastException Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/VELOCITY-98?page=comments#action_12361710 ] Will Glass-Husain commented on VELOCITY-98: ------------------------------------------- The problem reappeared once we changed the Exception handling code to pass through RuntimeExceptions. (hooray for the regression test case which suddenly started failing.) I've applied Michal's patch. Thanks for contributing! > #parse / #include causing ClassCastException > -------------------------------------------- > > Key: VELOCITY-98 > URL: http://issues.apache.org/jira/browse/VELOCITY-98 > Project: Velocity > Type: Bug > Components: Source > Versions: 1.3-rc1 > Environment: Operating System: Linux > Platform: All > Reporter: Simon Christian > Priority: Minor > Fix For: 1.5 > > If caching is on, and a template has been previously cached due to a #parse or > #include directive, subsequently using the other directive will cause a > ClassCastException and fail. > Example: if I have two templates, the first one loaded includes the line: > #include( "include/header.vtl" ) > and the second one the line: > #parse( "include/header.vtl" ) > When the second page is viewed, a ClassCastException is thrown with an error in > the log like: > [error] #parse() : arg = include/header.vtl. Exception : > java.lang.ClassCastException: > org.apache.velocity.runtime.resource.ContentResource > A solution might be to include the resourceType as part of the key when > caching/retrieving the resource, within the getResource() method of the > org.apache.velocity.runtime.resource.ResourceManagerImpl class. Alternatively > seperate caches could be used for the different types of Resource. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: velocity-dev-help@jakarta.apache.org