You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Greg Matthews <gm...@flex.com.au> on 2000/01/26 07:25:31 UTC

possible bug report

Dear all,

We're using Xerces-J 1.0.1 in a server being developed, and getting a NullPointerException in org.apache.xerces.dom.DeferredDocumentImpl.
See line below (1218) where error occurs.

Still trying to find a way to reproduce the error but only clues we
have at the moment are that multiple clients could be running
the same piece of our corba server code simulteously.

Please let me know if i'm doing something stupid.


Here's the method that currently gets called to serialize server
results into a String to send back to the client.

 public static String getString( Element element ) throws Exception {

  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  org.apache.xml.serialize.XMLSerializer serializer = createSerializer( baos );
  serializer.serialize( element );
  return baos.toString();
}


The createSerializer method just does this:

  org.apache.xml.serialize.XMLSerializer serializer = new XMLSerializer( out, _outputFormat );


where _outputFormat is a static defined with certain properties:

 static {
  _outputFormat.setOmitXMLDeclaration( true );
  _outputFormat.setIndenting( false );
  _outputFormat.setLineSeparator( "" );
 }




NullPointerException occurs in this method:

    /**
     * Synchronizes the node's children with the internal structure.
     * Fluffing the children at once solves a lot of work to keep
     * the two structures in sync. The problem gets worse when
     * editing the tree -- this makes it a lot easier.
     */
    protected void synchronizeChildren() {

        // no need to sync in the future
        syncChildren = false;

        getNodeType(0);

        // create children and link them as siblings
        NodeImpl last = null;
        for (int index = getFirstChild(0);
             index != -1;
             index = getNextSibling(index)) {

            NodeImpl node = (NodeImpl)getNodeObject(index);
            if (last == null) {
                firstChild = node;
            }
            else {
                last.nextSibling = node;
            }
            node.parentNode = this;          <= NullPointerException here
            node.previousSibling = last;
            last = node;

            // save doctype and document type
            int type = node.getNodeType();
            if (type == Node.ELEMENT_NODE) {
                docElement = (ElementImpl)node;
            }
            else if (type == Node.DOCUMENT_TYPE_NODE) {
                docType = (DocumentTypeImpl)node;
            }
        }

        if (last != null) {
            lastChild = last;
        }

    } // synchronizeChildren()


Re: possible bug report

Posted by Andy Clark <an...@apache.org>.
Greg Matthews wrote:
> 
> yes. using hotspot.
> 
> i submitted an update to this with a .java and .xml file that lets you
> reproduce the error, but will try without hotspot.
> 
> any way we can ship my reproducible error to javasoft for a possible hotspot
> fix?

Sure. All of our code is out in the open. So as long as they don't
mind receiving acouple MBs of Xerces code along with your test case,
I'm sure they'd appreciate the bug report. I know I would because
I don't want any more HotSpot bugs reported as Xerces bugs! ;)

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org

Re: possible bug report

Posted by Greg Matthews <gm...@flex.com.au>.
yes. using hotspot.

i submitted an update to this with a .java and .xml file that lets you
reproduce the error, but will try without hotspot.

any way we can ship my reproducible error to javasoft for a possible hotspot
fix?

thanks,
greg

----- Original Message -----
From: Andy Clark <an...@apache.org>
To: <xe...@xml.apache.org>
Sent: Thursday, January 27, 2000 1:41 PM
Subject: Re: possible bug report


> Greg,
>
> What's your platform, VM version, etc? We've been having a
> lot of NullPointerException "bugs" reported lately and in
> every case the user was using 1.2.2 with HotSpot. Without
> HotSpot, the problems went away.
>
> But if this is truly a bug, we'll hop on it right away!
>
> --
> Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org
>


Re: possible bug report

Posted by Andy Clark <an...@apache.org>.
Greg,

What's your platform, VM version, etc? We've been having a
lot of NullPointerException "bugs" reported lately and in
every case the user was using 1.2.2 with HotSpot. Without
HotSpot, the problems went away.

But if this is truly a bug, we'll hop on it right away!

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org

Re: possible bug report

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Greg Matthews wrote:
> 
> We're using Xerces-J 1.0.1 in a server being developed, and getting a
> NullPointerException in org.apache.xerces.dom.DeferredDocumentImpl.
> See line below (1218) where error occurs.

It's Hotspot for sure... I had several troubles with the deferred DOM
implemenatation using Hotspot 1.0.1...
I never tried out the new Hotspot 2.0 but definitely the 1.0.1 (and
previous) has bugs in code syncronization (something very very hidden,
because with some other tests it works perfectly)...

	Pier

-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------