You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org> on 2007/03/08 01:04:36 UTC

[jira] Closed: (VELOCITY-199) java.lang.ClassCastException: 'cache' doesn't map to a Boolean object

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

Henning Schmiedehausen closed VELOCITY-199.
-------------------------------------------


> java.lang.ClassCastException: 'cache' doesn't map to a Boolean object
> ---------------------------------------------------------------------
>
>                 Key: VELOCITY-199
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-199
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.3.1
>         Environment: Operating System: Linux
> Platform: PC
>            Reporter: Kris Nuttycombe
>             Fix For: 1.5
>
>         Attachments: patch
>
>
> The initialization fails entirely due to what appears to be a problem
> configuring the logsystem. I found a single reference to someone else
> encountering this problem in the Google cache at the URL listed above
> (http://216.239.37.104/search?q=cache:swlDhCygFHoJ:www.disastertravel.com/computers/java/velocity/example_servlet.php+velocity+java.lang.ClassCastException:+%27cache%27+doesn%27t+map+to+a+Boolean+object&hl=en&ie=UTF-8)
> In our case, the error occurs when initializing the standalone Velocity parser
> with the following code:
> Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
> "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
> Velocity.setProperty("runtime.log.logsystem.log4j.category", "velocity");
> Velocity.init();
> The "velocity" category is configured in the log4j_conf.xml file as:
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
>     <appender name="velocity_app" class="org.apache.log4j.FileAppender">
>         <param name="File"  
> value="/www/sites/tomcat/webapps/nndc/logs/idb_velocity.log" />
>         <param name="Append" value="true" />	    	
>         <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
>         </layout>	    
>     </appender>
>     <category name="velocity">
> 	<priority value="warn" />
>   	<appender-ref ref="velocity_app" />
>     </category>
>     <!-- Root & other categories snipped -->
> </log4j:configuration>
> Stack trace:
> java.lang.ClassCastException: 'cache' doesn't map to a Boolean object
> at org.apache.commons.collections.ExtendedProperties.getBoolean(Unknown Source)
> at org.apache.commons.collections.ExtendedProperties.getBoolean(Unknown Source)
> at
> org.apache.velocity.runtime.resource.loader.ResourceLoader.commonInit(ResourceLoader.java:116)
> at
> org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:186)
> at
> org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:502)
> at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:268)
> at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:169)
> at org.apache.velocity.app.Velocity.init(Velocity.java:123)
> at gov.noaa.nndc.idb.IdbTemplateParser.initVelocity(IdbTemplateParser.java:145)
> The handling of configuring the logsystem needs to be improved such that this is
> not a fatal error. However, this bug may be somewhat difficult to pin down as I
> am unable to reproduce the problem on my local system, but it occurs in the
> remote deployment. In any case, I suspect it to be related to problems writing
> the logfiles in the designated place that starts the chain of events that
> results in the (seemingly unrelated) error.

-- 
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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org