Return-Path: Delivered-To: apmail-community-commits-archive@minotaur.apache.org Received: (qmail 20409 invoked from network); 3 Dec 2009 10:18:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Dec 2009 10:18:55 -0000 Received: (qmail 12932 invoked by uid 500); 3 Dec 2009 10:18:55 -0000 Delivered-To: apmail-community-commits-archive@community.apache.org Received: (qmail 12915 invoked by uid 500); 3 Dec 2009 10:18:55 -0000 Mailing-List: contact commits-help@community.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@community.apache.org Delivered-To: mailing list commits@community.apache.org Received: (qmail 12904 invoked by uid 99); 3 Dec 2009 10:18:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Dec 2009 10:18:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Dec 2009 10:18:44 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2B1FE234C1F2 for ; Thu, 3 Dec 2009 02:18:23 -0800 (PST) Message-ID: <1944399368.1259835503175.JavaMail.jira@brutus> Date: Thu, 3 Dec 2009 10:18:23 +0000 (UTC) From: "Bertrand Delacretaz (JIRA)" To: commits@community.apache.org Subject: [jira] Commented: (COMDEV-4) External entity in XML causing null pointer exception during DocumentBuilder.parse In-Reply-To: <117042723.1259834431225.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COMDEV-4?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785249#action_12785249 ] Bertrand Delacretaz commented on COMDEV-4: ------------------------------------------ Doesn't look like a Community Development issue... > External entity in XML causing null pointer exception during DocumentBuilder.parse > ---------------------------------------------------------------------------------- > > Key: COMDEV-4 > URL: https://issues.apache.org/jira/browse/COMDEV-4 > Project: Community Development > Issue Type: Question > Reporter: sri kumar > > I was trying to parse a XML Document using DOM Parser. > I got null pointer exception while executing doc = builder.parse(xmlDataFile); > There were few entities in the XML data file. On removing a particular entity, i was able to parse the file successfully > The entity was some thing like this > > What could be the reason? > EDIT: > Here is the code: > DocumentBuilderFactory aFactory = DocumentBuilderFactory.newInstance(); > aFactory.setValidating(false); > aFactory.setFeature("http://xml.org/sax/features/namespaces", false); > aFactory.setFeature("http://apache.org/xml/features/validation/schema", false); > aFactory.setIgnoringComments(true); > builder = aFactory.newDocumentBuilder(); > doc = builder.parse(xmlDataFile); > This is the trace: > at com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl.setChunkIndex(DeferredDocumentImpl.java:1944) > at com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl.appendChild(DeferredDocumentImpl.java:644) > at com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser.characters(AbstractDOMParser.java:1191) > at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.characters(XMLDTDValidator.java:862) > at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:463) > at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) > at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) > at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) > at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225) > at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) > at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180) > at XMLParser.Parse(XMLParser.java:89) > at Main.main(Main.java:116) > 89 line number points to -> doc = builder.parse(xmlDataFile); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.