Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-286

XmlObject.copy().getDomNode().getOwnerDocument() throws ClassCastException for simple types and complex types.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Version 2.2
    • Fix Version/s: None
    • Component/s: DOM
    • Labels:
      None
    • Environment:
      Windows XP Pro SP2, Mac OSX 10.4
      Java 1.5.0_06

      Description

      The following code fails:
      --------------------------------------------------------------------------------
      XmlString string = XmlString.Factory.newInstance();
      string.setStringValue("test");
      string.copy().getDomNode().getOwnerDocument();
      --------------------------------------------------------------------------------
      With the exception:
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------
      Exception in thread "main" java.lang.ClassCastException: org.apache.xmlbeans.impl.store.Xobj$DocumentFragXobj
      at org.apache.xmlbeans.impl.store.DomImpl._node_getOwnerDocument(DomImpl.java:1180)
      at org.apache.xmlbeans.impl.store.Xobj$NodeXobj.getOwnerDocument(Xobj.java:2568)
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------

      I can trace it to the org.apache.xmlbeans.impl.store.Cur class in the createDomDocumentRootXobj method where l._ownerDoc is set even is a fragment was created which is not appropriate.

        Attachments

          Activity

            People

            • Assignee:
              cezar Cezar Cristian Andrei
              Reporter:
              ldomenech Laurent Domenech
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: