Document.importNode bug

From: Chesko, Jason <jason.chesko@xxx.com>
Date: Fri Sep 20 2002 - 13:54:44 PDT

We're trying to import an element from one Document into another document
but we're getting a stack overflow error:

Sample code:

    Document document = documentBuilder.newDocument();
    Element eDeptList = (Element)
servletContext.getAttribute(DEPARTMENT_LIST);
    Node newNode = document.importNode(eDeptList, true);

Error:

500 Servlet Exception
java.lang.StackOverflowError
        at com.caucho.xml.QNode.appendChild(QNode.java:209)
        at com.caucho.xml.QElement.appendChild(QElement.java:215)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        at com.caucho.xml.QElement.importNode(QElement.java:290)
        ...... continues on with this message

We've encountered this error using Resin 2.1.0 and 2.1.4. Were using Sun SDK
1.4.0 on Windows 2000. If we do importNode(eDeptList, false) we do not get
the error. Of course we also don't get the results we need :-) Also, we
can create the same error doing eDeptList.cloneNode(true). I haven't had a
chance to get into the code but I assume that importNode is doing a
cloneNode within it so the problem probably lies there. Anyone seen this
problem? Are we doing something wrong or is this a bug?

Thanks,

Jason Chesko
Lead Web Architect
Brightpoint North America, L.P.
Received on Fri 20 Sep 2002 13:54:44 -0700

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:17:15 PDT