http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2031 *** shadow/2031 Wed Jun 6 09:44:59 2001 --- shadow/2031.tmp.11417 Wed Jun 6 09:44:59 2001 *************** *** 0 **** --- 1,127 ---- + +============================================================================+ + | Error in DeferredDocumentImpl.synchronizeChildren | + +----------------------------------------------------------------------------+ + | Bug #: 2031 Product: Xerces2-J | + | Status: NEW Version: 2.0.0 [alpha] | + | Resolution: Platform: PC | + | Severity: Blocker OS/Version: Windows NT/2K | + | Priority: Other Component: DOM | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + I wrote a test servlet to for testing new Xerces parser. + It works fine. My servlet does shows all the tag values on server console. + But, after few number for calls ( after about calling servlet for 100/125 + times) to the servlet I get following error. + + + java.lang.NullPointerException + java.lang.NullPointerException + at org.apache.xerces.dom.DeferredDocumentImpl.synchronizeChildren + (DeferredDocumentImpl.java:1402) + at org.apache.xerces.dom.ParentNode.hasChildNodes(ParentNode.java:215) + at org.apache.xerces.dom.NodeIteratorImpl.nextNode + (NodeIteratorImpl.java:298) + at org.apache.xerces.dom.NodeIteratorImpl.nextNode + (NodeIteratorImpl.java:192) + at tx.dhs.nq1.publ.utility.testxml4.parsexml(testxml4.java:240) + at tx.dhs.nq1.publ.utility.testxml4.service(testxml4.java:182) + at com.sssw.srv.busobj.AgoServletInvoker.serviceRequest + (AgoServletInvoker.java:106) + at com.sssw.srv.resources.AgServletResource.service + (AgServletResource.java:149) + at com.sssw.srv.resources.AgServletResource.perform + (AgServletResource.java:107) + at com.sssw.srv.http.httpd.perform(httpd.java:3700) + at com.sssw.srv.http.Client.processRequest(Client.java:821) + at com.sssw.srv.http.Client.loop(Client.java:1151) + at com.sssw.srv.http.Client.runConnection(Client.java:1353) + at com.sssw.srv.http.Client.run(Client.java:1313) + at java.lang.Thread.run(Thread.java:479) + + + + + The XML + ******************************************************************************** + ************************************************************************** + <?xml version="1.0"?> + <!DOCTYPE directory SYSTEM "providerinfo.dtd"> + <providerinfo> + <provider id="000107" lang="en"> + <event type="ENTITY"> + <event_item> + <reg_date type="Date">19981231</reg_date> + <reg_desc type="String"><![CDATA[On all inspections from + 07/01/1997 to 12/31/1997, this facility was in <B>substantial compliance</B> + with regulations.]]></reg_desc> + </event_item> + + <event_item> + <reg_date type="Date">19981231</reg_date> + <reg_desc type="String"><![CDATA[On one or more + inspections from 01/01/1998 to 12/31/1998, this facility was found to be <B>out + of compliance</B> with regulations. There were no deficiencies that caused + residents actual harm or immediate jeopardy.]]></reg_desc> + </event_item> + <event_item> + <reg_date type="Date">19990824</reg_date> + <reg_desc type="String"><![CDATA[On all inspections + from 01/01/1999 to 08/24/1999, this facility was in <B>substantial + compliance</B> with regulations.]]></reg_desc> + </event_item> + + <event_item> + <reg_date type="Date">20000712</reg_date> + <reg_desc type="String"><![CDATA[On one or more + inspections from 01/01/2000 to 07/12/2000, this facility was found to be <B>out + of compliance</B> with regulations. There were no deficiencies that caused + residents actual harm or immediate jeopardy.]]></reg_desc> + </event_item> + </event> + </provider> + </providerinfo> + ******************************************************************************** + ************************************************************************** + + The parsing code + + + try{ + Document doc = null; + NodeIterator iter = null; + TreeWalker walker = null; + + DocumentBuilderFactory dbf = + DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + doc = db.parse(sPath); + + iter= ((DocumentTraversal) + doc).createNodeIterator(doc , NodeFilter.SHOW_ALL, null, true); + Node n ; + while (( n= (Node) iter.nextNode()) != + null){ + if (( n.getNodeName() != null) + && (!("".equals(n.getNodeName()))) && (n.getNodeType()==1)){ + Element e= + (Element) n; + if + (n.getFirstChild() != null) { + + System.out.println("Node name ="+n.getNodeName() + " value ="+ (n.getFirstChild + ()).getNodeValue() ); + } + } + + } + + } + catch(Exception e){ + System.out.println(e); + e.printStackTrace(); + } \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]