java.lang.ClassCastException: ElementImpl cannot be cast to NodeWrapper

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.ClassCastException: ElementImpl cannot be cast to NodeWrapper

Chris K Wensel-2
hey all,

i've just started seeing the below stack trace.

it happens when I xforms:delete an item. before a xforms-delete event is dispatched, a xforms-enabled event is caught which issues a xforms:send submission. and before any events are printed to the debug log, the below trace dumps.

to make this more difficult, i've traced this down to another xforms:repeat that ref's the instance the above submission 'replaces'. if i comment out the xforms:send above, things work fine.
here's the xhmtl:

<xforms:group ref="instance('source')/*[1]">
    <xforms:output ref=".">
        <xforms:label value="concat( local-name(.), ': ')"/>
    </xforms:output>
    <ul>
       <!-- I CHOKE HERE -->
        <xforms:repeat nodeset="*" id='repeat-source'>
            <li>
                <xforms:output ref=".">
                    <xforms:label value="concat( local-name(.), ': ')"/>
                </xforms:output>
                <ul>
                    <xforms:repeat nodeset="*" id='repeat-source-next'>
                        <li>
                            <xforms:output ref=".">
                                <xforms:label value="concat( local-name(.), ': ')"/>
                            </xforms:output>
                        </li>
                    </xforms:repeat>
                </ul>
            </li>
        </xforms:repeat>
    </ul>
</xforms:group>

btw, is there a better way to render a tree? that may overcome this issue. 

let me know if you want a longer stack trace...

2007-08-08 14:26:09,243 http-8080-Processor25 DEBUG processor.XFormsServer  - XForms - executing action: delete
2007-08-08 14:26:09,252 http-8080-Processor25 DEBUG processor.XFormsServer  - XForms - containing document cache: throwable caught, discarding document from pool.
2007-08-08 14:26:09,261 http-8080-Processor25 ERROR webapp.ProcessorService  - Exception at null, line -1, column -1
java.lang.ClassCastException: org.orbeon.saxon.tree.ElementImpl cannot be cast to org.orbeon.saxon.dom4j.NodeWrapper
at org.orbeon.oxf.xforms.XFormsIndexUtils$3.startVisitControl(XFormsIndexUtils.java:280)
at org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1727)
at org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
at org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
at org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
at org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
at org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1719)
at org.orbeon.oxf.xforms.XFormsIndexUtils.adjustIndexesForDelete(XFormsIndexUtils.java:261)
at org.orbeon.oxf.xforms.action.actions.XFormsDeleteAction.execute(XFormsDeleteAction.java:159)
at org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:116)
at org.orbeon.oxf.xforms.action.actions.XFormsActionAction.execute(XFormsActionAction.java:32)
at org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:116)
at org.orbeon.oxf.xforms.XFormsContainingDocument.runAction(XFormsContainingDocument.java:972)
at org.orbeon.oxf.xforms.event.XFormsEventHandlerImpl.handleEvent(XFormsEventHandlerImpl.java:122)



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassCastException: ElementImpl cannot be cast to NodeWrapper

Erik Bruchez
Administrator
Chris,

Do you happen to have read-only instances?

At any rate, I implemented a fix which should avoid that class cast:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=307416&group_id=168&atid=350207

Regarding trees, we support trees through xforms:select and
xforms:select1 with the xxforms:tree appearance. We have a sample in the
sandbox, called tree.xhtml:

   http://www.orbeon.com/ops/xforms-sandbox/sample/tree       

-Erik

Chris K Wensel wrote:

> hey all,
>
> i've just started seeing the below stack trace.
>
> it happens when I xforms:delete an item. before a xforms-delete event is
> dispatched, a xforms-enabled event is caught which issues a xforms:send
> submission. and before any events are printed to the debug log, the
> below trace dumps.
>
> to make this more difficult, i've traced this down to another
> xforms:repeat that ref's the instance the above submission 'replaces'.
> if i comment out the xforms:send above, things work fine.
> here's the xhmtl:
>
> <xforms:group ref="instance('source')/*[1]">
>     <xforms:output ref=".">
>         <xforms:label value="concat( local-name(.), ': ')"/>
>     </xforms:output>
>     <ul>
> *       <!-- I CHOKE HERE -->*
> *        <xforms:repeat nodeset="*" id='repeat-source'>*
> *            <li>*
> *                <xforms:output ref=".">*
> *                    <xforms:label value="concat( local-name(.), ': ')"/>*
> *                </xforms:output>*
> *                <ul>*
> *                    <xforms:repeat nodeset="*" id='repeat-source-next'>*
> *                        <li>*
> *                            <xforms:output ref=".">*
> *                                <xforms:label value="concat(
> local-name(.), ': ')"/>*
> *                            </xforms:output>*
> *                        </li>*
> *                    </xforms:repeat>*
> *                </ul>*
> *            </li>*
> *        </xforms:repeat>*
>     </ul>
> </xforms:group>
>
> btw, is there a better way to render a tree? that may overcome this issue.
>
> let me know if you want a longer stack trace...
>
> 2007-08-08 14:26:09,243 http-8080-Processor25 DEBUG
> processor.XFormsServer  - XForms - executing action: delete
> 2007-08-08 14:26:09,252 http-8080-Processor25 DEBUG
> processor.XFormsServer  - XForms - containing document cache: throwable
> caught, discarding document from pool.
> 2007-08-08 14:26:09,261 http-8080-Processor25 ERROR
> webapp.ProcessorService  - Exception at null, line -1, column -1
> java.lang.ClassCastException: org.orbeon.saxon.tree.ElementImpl cannot
> be cast to org.orbeon.saxon.dom4j.NodeWrapper
> at
> org.orbeon.oxf.xforms.XFormsIndexUtils$3.startVisitControl(XFormsIndexUtils.java:280)
> at
> org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1727)
> at
> org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
> at
> org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
> at
> org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
> at
> org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
> at
> org.orbeon.oxf.xforms.XFormsControls$ControlsState.visitControlsFollowRepeats(XFormsControls.java:1719)
> at
> org.orbeon.oxf.xforms.XFormsIndexUtils.adjustIndexesForDelete(XFormsIndexUtils.java:261)
> at
> org.orbeon.oxf.xforms.action.actions.XFormsDeleteAction.execute(XFormsDeleteAction.java:159)
> at
> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:116)
> at
> org.orbeon.oxf.xforms.action.actions.XFormsActionAction.execute(XFormsActionAction.java:32)
> at
> org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction(XFormsActionInterpreter.java:116)
> at
> org.orbeon.oxf.xforms.XFormsContainingDocument.runAction(XFormsContainingDocument.java:972)
> at
> org.orbeon.oxf.xforms.event.XFormsEventHandlerImpl.handleEvent(XFormsEventHandlerImpl.java:122)
>

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassCastException: ElementImpl cannot be cast to NodeWrapper

Chris K Wensel-2
Yes, the 'source' instance is read-only (the instance being rendered  
below). Interestingly when I change that, the whole thing goes  
squirrely  (loops quite a while reloading the 'source' submission).  
but it looks like I can now delete (if the side-effects weren't so  
painful). I likely need to rethink things here.

I took a quick stab at the tree and literally nothing happens. the  
page just freezes, nothing in the logs. note the 'source' instance  
isn't homogeneous and was read-only.

is the code the in repo the 3.5.2 candidate, or 3.6beta?

thanks!

On Aug 9, 2007, at 10:15 AM, Erik Bruchez wrote:

> Chris,
>
> Do you happen to have read-only instances?
>
> At any rate, I implemented a fix which should avoid that class cast:
>
> http://forge.objectweb.org/tracker/index.php?
> func=detail&aid=307416&group_id=168&atid=350207
>
> Regarding trees, we support trees through xforms:select and  
> xforms:select1 with the xxforms:tree appearance. We have a sample  
> in the sandbox, called tree.xhtml:
>
>   http://www.orbeon.com/ops/xforms-sandbox/sample/tree       
>
> -Erik
>
> Chris K Wensel wrote:
>> hey all,
>> i've just started seeing the below stack trace.
>> it happens when I xforms:delete an item. before a xforms-delete  
>> event is dispatched, a xforms-enabled event is caught which issues  
>> a xforms:send submission. and before any events are printed to the  
>> debug log, the below trace dumps.
>> to make this more difficult, i've traced this down to another  
>> xforms:repeat that ref's the instance the above submission  
>> 'replaces'. if i comment out the xforms:send above, things work fine.
>> here's the xhmtl:
>> <xforms:group ref="instance('source')/*[1]">
>>     <xforms:output ref=".">
>>         <xforms:label value="concat( local-name(.), ': ')"/>
>>     </xforms:output>
>>     <ul>
>> *       <!-- I CHOKE HERE -->*
>> *        <xforms:repeat nodeset="*" id='repeat-source'>*
>> *            <li>*
>> *                <xforms:output ref=".">*
>> *                    <xforms:label value="concat( local-name(.),  
>> ': ')"/>*
>> *                </xforms:output>*
>> *                <ul>*
>> *                    <xforms:repeat nodeset="*" id='repeat-source-
>> next'>*
>> *                        <li>*
>> *                            <xforms:output ref=".">*
>> *                                <xforms:label value="concat
>> ( local-name(.), ': ')"/>*
>> *                            </xforms:output>*
>> *                        </li>*
>> *                    </xforms:repeat>*
>> *                </ul>*
>> *            </li>*
>> *        </xforms:repeat>*
>>     </ul>
>> </xforms:group>
>> btw, is there a better way to render a tree? that may overcome  
>> this issue. let me know if you want a longer stack trace...
>> 2007-08-08 14:26:09,243 http-8080-Processor25 DEBUG  
>> processor.XFormsServer  - XForms - executing action: delete
>> 2007-08-08 14:26:09,252 http-8080-Processor25 DEBUG  
>> processor.XFormsServer  - XForms - containing document cache:  
>> throwable caught, discarding document from pool.
>> 2007-08-08 14:26:09,261 http-8080-Processor25 ERROR  
>> webapp.ProcessorService  - Exception at null, line -1, column -1
>> java.lang.ClassCastException: org.orbeon.saxon.tree.ElementImpl  
>> cannot be cast to org.orbeon.saxon.dom4j.NodeWrapper
>> at org.orbeon.oxf.xforms.XFormsIndexUtils$3.startVisitControl
>> (XFormsIndexUtils.java:280)
>> at org.orbeon.oxf.xforms.XFormsControls
>> $ControlsState.visitControlsFollowRepeats(XFormsControls.java:1727)
>> at org.orbeon.oxf.xforms.XFormsControls
>> $ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
>> at org.orbeon.oxf.xforms.XFormsControls
>> $ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
>> at org.orbeon.oxf.xforms.XFormsControls
>> $ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
>> at org.orbeon.oxf.xforms.XFormsControls
>> $ControlsState.visitControlsFollowRepeats(XFormsControls.java:1743)
>> at org.orbeon.oxf.xforms.XFormsControls
>> $ControlsState.visitControlsFollowRepeats(XFormsControls.java:1719)
>> at org.orbeon.oxf.xforms.XFormsIndexUtils.adjustIndexesForDelete
>> (XFormsIndexUtils.java:261)
>> at org.orbeon.oxf.xforms.action.actions.XFormsDeleteAction.execute
>> (XFormsDeleteAction.java:159)
>> at org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction
>> (XFormsActionInterpreter.java:116)
>> at org.orbeon.oxf.xforms.action.actions.XFormsActionAction.execute
>> (XFormsActionAction.java:32)
>> at org.orbeon.oxf.xforms.action.XFormsActionInterpreter.runAction
>> (XFormsActionInterpreter.java:116)
>> at org.orbeon.oxf.xforms.XFormsContainingDocument.runAction
>> (XFormsContainingDocument.java:972)
>> at org.orbeon.oxf.xforms.event.XFormsEventHandlerImpl.handleEvent
>> (XFormsEventHandlerImpl.java:122)
>
>
> --
> Orbeon Forms - Web Forms for the Enterprise Done the Right Way
> http://www.orbeon.com/
>
>
> --
> You receive this message as a subscriber of the ops-
> [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/ 
> wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassCastException: ElementImpl cannot be cast to NodeWrapper

Erik Bruchez
Administrator
Chris K Wensel wrote:

> I took a quick stab at the tree and literally nothing happens. the page
> just freezes, nothing in the logs.

A freeze? Can you make a reproducible case that runs in the sandbox?

> is the code the in repo the 3.5.2 candidate, or 3.6beta?

There won't be a 3.5.2, there will be a 3.6 instead. Doing a 3.5.2
release didn't sound ambitious enough given that we already have more
than 100 new fixes and features since 3.5.1.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws