cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <>
Subject Re: RCL, Session and ClassCastException
Date Sat, 29 Dec 2007 19:01:17 GMT
Torsten Curdt wrote:
> On 29.12.2007, at 19:40, Reinhard Poetz wrote:
>> Robin Wyles wrote:
>>> Hi,
>>> When developing using the RCL it seems that after I update any file 
>>> that triggers a reload (e.g. sitemap) any references in my Java code 
>>> to objects stored in the current session result in a 
>>> ClassCastException. Debugging shows that the object is still there in 
>>> the session after the reload, and it is of the correct class, so does 
>>> anyone know why I should get this error?
>> The object that you put into the session is loaded by one classloader 
>> and then after a reload you cast it using another one.
> Correct. A classloader is somewhat like a namespace in xml.
>  <a:tag/> != <b:tag/>
> Objects can only be casted if their classes have been loaded by the same 
> classloader. No matter they are maybe loaded from the same class file.
>> This seems to be a bug in the reloading classloader or the way how we 
>> use it. Unfortunatly I haven't had the time yet to create a test case 
>> that demonstrates the problem in an isolated environment so that the 
>> Commons JCI guys can have a look at this problem (if it's their problem).
> This could be changed 

That would be really great!!!

> ...but it's a bit of an effort and adds to the 
> complexity.

I think it would be worth changing the implementation because there are many 
people that can't or don't want to avoid the usage of sessions.

Reinhard Pötz                            Managing Director, {Indoqa} GmbH

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member, PMC Chair

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

View raw message