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

Daniel Kulp reassigned CXF-2829:
--------------------------------

    Assignee: Daniel Kulp

> W3CDOMStreamReader is not compatible with wstx XMLEventReader
> -------------------------------------------------------------
>
>                 Key: CXF-2829
>                 URL: https://issues.apache.org/jira/browse/CXF-2829
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.8
>         Environment: Mule 2.2.6-snapshot in proxy mode, and WS-Security 
> (wss4j)
> WSTX 4.0.8
>            Reporter: sebastien chatel
>            Assignee: Daniel Kulp
>            Priority: Minor
>
> If you create an XMLEventReader from a W3CDOMStreamReader (with the woodstox 
> library), it will fail because XMLEventAllocator doesnt accept Attribute 
> XMLEvent :
> Caused by: com.ctc.wstx.exc.WstxException: Internal error: should not get [13]
>       at 
> com.ctc.wstx.evt.DefaultEventAllocator.allocate(DefaultEventAllocator.java:256)
>       at 
> org.codehaus.stax2.ri.Stax2EventReaderImpl.createNextEvent(Stax2EventReaderImpl.java:411)
>       at 
> org.codehaus.stax2.ri.Stax2EventReaderImpl.nextEvent(Stax2EventReaderImpl.java:255)
> Here is the comment in wstx source code :
> -------------8<-------------8<-------------8<-------------8<-------------8<-------------
>             /* Following 2 types should never get in here; they are directly
>              * handled by the reader, and can only be accessed via start
>              * element.
>              */
>         case NAMESPACE:
>         case ATTRIBUTE:
>             throw new WstxException("Internal error: should not get "
>                                     
> +ErrorConsts.tokenTypeDesc(r.getEventType()));
> -------------8<-------------8<-------------8<-------------8<-------------8<-------------
> To create a XMLStreamReader from a DOM Document or Node, i recommand to 
> simply use XMLInputFactory.createStreamReader(source), where source is a 
> DOMSource.
> I think it's better to rely on stax implementation to create a StreamReader 
> from a DOM Node.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to