[ 
https://issues.apache.org/jira/browse/VELOCITY-98?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henning Schmiedehausen closed VELOCITY-98.
------------------------------------------


> #parse / #include causing ClassCastException
> --------------------------------------------
>
>                 Key: VELOCITY-98
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-98
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects 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.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to