velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Christian <>
Subject Re: ClassCastException ruining my fun
Date Tue, 12 Apr 2005 17:28:55 GMT

N J Higgs wrote:
> The odd thing is I haven't specified a file, and have been
> relying on the default. The
> org\apache\velociy\runtime\defaults\ file seems to be in
> order.
> While experimenting I've found that if I set the offending property in the code
> using Properties.setProperty(), then another property causes a similar
> exception, like so:
> javax.servlet.ServletException: Error initializing Velocity:
> java.lang.ClassCastException: 'modificationCheckInterval' doesn't map to a Long
> object
> It seems that wherever these property settings are coming from, the last word in
> the property identifier is being obtained instead of the value. Anyone know why
> this would happen?

That's simply how the error is reported from the ExtendedProperties 
class - including the key name rather than the value.

What you're seeing might actually suggest that it can't find the default at all, though I'd have thought that would produce a 

- s

>>It looks like your file has some errors in it. It 
>>would be helpful if you posted the contents of that file here, but at a 
>>wild guess you may have a line that looks like this:
>>  file.resource.loader.cache = {something other than a boolean}
>>, where it should look like:
>>  file.resource.loader.cache = true
>>Alternatively it could be whitespace after the end of a similar property 
>>  entry (not sure how the o.a.c.c.ExtendedProperties class deals with 
>>that but java.util.Properties doesn't like it).
>>I'm somewhat surprised that it only fails intermittently, but all may 
>>become clear..
>>- simon
>>N J Higgs wrote:
>>>My VelocityServlets are intermittently failing due to a ClassCastExeption.
>>>Stack trace is appended to the end of this message. Does anyone know
>>>going wrong?
>>>javax.servlet.ServletException: Error initializing Velocity:
>>>java.lang.ClassCastException: 'cache' doesn't map to a Boolean object
>>>	at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message