cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Per-Olof Noren <>
Subject Re: Flow ClassCastException
Date Tue, 21 Oct 2003 09:39:14 GMT
Hi again,

Sorry for the silence,

On Thu, 2003-10-16 at 17:19, Christopher Oliver wrote:
> Your code should work. The class cast exception indicates a bug 
> (probably in ScriptablePropertyPointer). You should be able to pass 
> _any_ Java or JavaScript object to sendPageAndWait(). I don't have time 
> to look into this right now but my first guess would be to do remove the 
> unwrap-ing code below. Rhino wraps normal Java objects with a Scriptable 
> wrapper which JXPath associates with the ScriptablePropertyPointer, so I 
> don't think it's correct to unwrap it.

What seems to work for me was this:

  public Object getImmediateNode() {
        Object value;
        if (index == WHOLE_COLLECTION) {
            value = node;
        } else {
            value = ScriptableObject.getProperty(node, index);
            if (value == ScriptableObject.NOT_FOUND) {
                value = node; // hack: same behavior as ...
        if (value instanceof Wrapper) {
            //value = ((Wrapper)value).unwrap(); <<- Commented this out
        return value;

Our project's timetable prohibits me to investigate this further for the
next two weeks. I'd really appreciate if someone other than me could
verify the correctness of this change. 

Per-Olof Norén
Curalia AB

View raw message