[ 
https://issues.apache.org/jira/browse/AXIOM-487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15477141#comment-15477141
 ] 

Victor commented on AXIOM-487:
------------------------------

So after much investigation, I seem to mitigate this bug (if it's really a 
bug…) by converting my DOMSource first to a Stream then to a StreamSource.
Apparently the parser (a javax.xml.transform.Transformer) from Java seems to 
have no problem reading my problematic DOMSource so I can then use the created 
Stream to build a StreamSource and pass it to sample code of the issue 
description without any problems.

Maybe to help investigate the source of all of this, here is the code that 
built the faulty DOMSource: 
http://fisheye.ow2.org/browse/Petals/petals/components-sls/components/petals-se-talend/src/main/java/org/ow2/petals/se/talend/processor/AbstractExchangeProcessor.java?hb=true#to776

> IllegalStateException when parsing Source document
> --------------------------------------------------
>
>                 Key: AXIOM-487
>                 URL: https://issues.apache.org/jira/browse/AXIOM-487
>             Project: Axiom
>          Issue Type: Bug
>    Affects Versions: 1.2.17, 1.2.19
>            Reporter: Victor
>
> Hello,
> I tried to parse a java.xml.transform.Source (a DOMSource) using the 
> following code:
> {code}
> final OMXMLParserWrapper builder = 
> OMXMLBuilderFactory.createOMBuilder(factory, source);
> final OMElement bodyContent = builder.getDocumentElement();
> {code}
> The document contains:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <tns:executeJobResponse 
> xmlns:tns="http://petals.ow2.org/talend/ArticleImporterJob/"; 
> xmlns:jaxb="http://jaxb.dev.java.net/array";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>     <tns:talend-job-output>
>         <tns:executionResult>
>             <jaxb:item>0</jaxb:item>
>         </tns:executionResult>
>         <tns:outAttachment>
>             <tns:fileResult>
>                 <tns:fileContent>
>                     <xop:include 
> xmlns:xop="http://www.w3.org/2004/08/xop/include"; href="cid:fileResult" />
>                 </tns:fileContent>
>             </tns:fileResult>
>         </tns:outAttachment>
>     </tns:talend-job-output>
> </tns:executeJobResponse>
> {code}
> And I got the following error:
> {noformat}
> java.lang.IllegalStateException
>       at 
> org.apache.axiom.om.impl.common.AxiomNamedInformationItemSupport.ajc$interMethod$org_apache_axiom_om_impl_common_AxiomNamedInformationItemSupport$org_apache_axiom_om_impl_intf_AxiomNamedInformationItem$updateLocalName(AxiomNamedInformationItemSupport.aj:142)
>       at 
> org.apache.axiom.om.impl.llom.OMAttributeImpl.updateLocalName(OMAttributeImpl.java:1)
>       at 
> org.apache.axiom.om.impl.common.AxiomNamedInformationItemSupport.ajc$interMethodDispatch1$org_apache_axiom_om_impl_common_AxiomNamedInformationItemSupport$org_apache_axiom_om_impl_intf_AxiomNamedInformationItem$updateLocalName(AxiomNamedInformationItemSupport.aj)
>       at 
> org.apache.axiom.om.impl.common.AxiomNamedInformationItemSupport.ajc$interMethod$org_apache_axiom_om_impl_common_AxiomNamedInformationItemSupport$org_apache_axiom_om_impl_intf_AxiomNamedInformationItem$coreGetLocalName(AxiomNamedInformationItemSupport.aj:147)
>       at 
> org.apache.axiom.om.impl.llom.OMAttributeImpl.coreGetLocalName(OMAttributeImpl.java:1)
>       at 
> org.apache.axiom.core.NSAwareAttributeMatcher.getName(NSAwareAttributeMatcher.java:84)
>       at 
> org.apache.axiom.core.CoreElementSupport.ajc$interMethod$org_apache_axiom_core_CoreElementSupport$org_apache_axiom_core_CoreElement$coreSetAttribute(CoreElementSupport.aj:96)
>       at 
> org.apache.axiom.om.impl.llom.OMElementImpl.coreSetAttribute(OMElementImpl.java:1)
>       at 
> org.apache.axiom.om.impl.common.AxiomElementSupport.ajc$interMethod$org_apache_axiom_om_impl_common_AxiomElementSupport$org_apache_axiom_om_impl_intf_AxiomElement$internalAppendAttribute(AxiomElementSupport.aj:282)
>       at 
> org.apache.axiom.om.impl.llom.OMElementImpl.internalAppendAttribute(OMElementImpl.java:1)
>       at 
> org.apache.axiom.om.impl.common.AxiomElementSupport.ajc$interMethodDispatch1$org_apache_axiom_om_impl_common_AxiomElementSupport$org_apache_axiom_om_impl_intf_AxiomElement$internalAppendAttribute(AxiomElementSupport.aj)
>       at 
> org.apache.axiom.om.impl.common.AxiomElementSupport.ajc$interMethod$org_apache_axiom_om_impl_common_AxiomElementSupport$org_apache_axiom_om_impl_intf_AxiomElement$addAttribute(AxiomElementSupport.aj:296)
>       at 
> org.apache.axiom.om.impl.llom.OMElementImpl.addAttribute(OMElementImpl.java:1)
>       at 
> org.apache.axiom.om.impl.common.AxiomElementSupport.ajc$interMethodDispatch1$org_apache_axiom_om_impl_common_AxiomElementSupport$org_apache_axiom_om_impl_intf_AxiomElement$addAttribute(AxiomElementSupport.aj)
>       at 
> org.apache.axiom.om.impl.common.AxiomElementSupport.ajc$interMethod$org_apache_axiom_om_impl_common_AxiomElementSupport$org_apache_axiom_om_impl_intf_AxiomElement$addAttribute(AxiomElementSupport.aj:312)
>       at 
> org.apache.axiom.om.impl.llom.OMElementImpl.addAttribute(OMElementImpl.java:1)
>       at 
> org.apache.axiom.om.impl.builder.StAXBuilder.processAttributes(StAXBuilder.java:247)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.populateOMElement(StAXOMBuilder.java:418)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.createOMElement(StAXOMBuilder.java:434)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.createNextOMElement(StAXOMBuilder.java:298)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:215)
>       at 
> org.apache.axiom.core.CoreParentNodeSupport.ajc$interMethod$org_apache_axiom_core_CoreParentNodeSupport$org_apache_axiom_core_CoreParentNode$buildNext(CoreParentNodeSupport.aj:96)
>       at 
> org.apache.axiom.om.impl.llom.OMDocumentImpl.buildNext(OMDocumentImpl.java:1)
>       at 
> org.apache.axiom.core.CoreParentNodeSupport.ajc$interMethodDispatch1$org_apache_axiom_core_CoreParentNodeSupport$org_apache_axiom_core_CoreParentNode$buildNext(CoreParentNodeSupport.aj)
>       at 
> org.apache.axiom.core.CoreParentNodeSupport.ajc$interMethod$org_apache_axiom_core_CoreParentNodeSupport$org_apache_axiom_core_CoreParentNode$coreGetFirstChild(CoreParentNodeSupport.aj:113)
>       at 
> org.apache.axiom.om.impl.llom.OMDocumentImpl.coreGetFirstChild(OMDocumentImpl.java:1)
>       at 
> org.apache.axiom.core.CoreParentNodeSupport.ajc$interMethodDispatch1$org_apache_axiom_core_CoreParentNodeSupport$org_apache_axiom_core_CoreParentNode$coreGetFirstChild(CoreParentNodeSupport.aj)
>       at 
> org.apache.axiom.core.CoreDocumentSupport.ajc$interMethod$org_apache_axiom_core_CoreDocumentSupport$org_apache_axiom_core_CoreDocument$coreGetDocumentElement(CoreDocumentSupport.aj:42)
>       at 
> org.apache.axiom.om.impl.llom.OMDocumentImpl.coreGetDocumentElement(OMDocumentImpl.java:1)
>       at 
> org.apache.axiom.om.impl.common.AxiomDocumentSupport.ajc$interMethod$org_apache_axiom_om_impl_common_AxiomDocumentSupport$org_apache_axiom_om_impl_intf_AxiomDocument$getOMDocumentElement(AxiomDocumentSupport.aj:32)
>       at 
> org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:1)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:554)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:550)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to