Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 25537 invoked from network); 16 Feb 2008 00:09:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Feb 2008 00:09:06 -0000 Received: (qmail 61567 invoked by uid 500); 16 Feb 2008 00:08:56 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 61505 invoked by uid 500); 16 Feb 2008 00:08:56 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 61496 invoked by uid 99); 16 Feb 2008 00:08:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2008 16:08:56 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.27.42.30] (HELO smtp4-g19.free.fr) (212.27.42.30) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Feb 2008 00:08:09 +0000 Received: from smtp4-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp4-g19.free.fr (Postfix) with ESMTP id C06FE3EA0C8 for ; Sat, 16 Feb 2008 01:08:30 +0100 (CET) Received: from [192.168.1.101] (did75-15-88-160-185-18.fbx.proxad.net [88.160.185.18]) by smtp4-g19.free.fr (Postfix) with ESMTP id 74D793EA0B9 for ; Sat, 16 Feb 2008 01:08:30 +0100 (CET) Message-ID: <47B6297E.1070501@apache.org> Date: Sat, 16 Feb 2008 01:08:30 +0100 From: Emmanuel Bourg User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: Commons Configuration References: <150833.45284.qm@web33614.mail.mud.yahoo.com> In-Reply-To: <150833.45284.qm@web33614.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org It seems there is an issue with the DTD validation. What's the result of this line in your test class ? getClass().getClassLoader().getResource("PropertyList-1.0.dtd") Does it return a null value ? Emmanuel Bourg comctrl6 a �crit : > I believe the problem is with the way Configuration is setting up the XML parser. > > The following test code works and reports the number of nodes correctly, which is 2 (the doctype and the main plist element). However, as in my last email, a NullPointerException is thrown when I try to load the same XML file using configuration. > > public static void main(String[] args) { > try { > Document doc = XmlDocument.createXmlDocument(new File("test.plist.xml").getAbsolutePath()); > System.out.println(doc.getChildNodes().getLength()); > } catch (IOException e) { > e.printStackTrace(); > } catch (SAXException e) { > e.printStackTrace(); > } > } > > Just for the sake of completeness, I went ahead and tested the code from my last email with > Java 1.5. I can't use 1.5 in the project, but I just wanted to see if Configuration > would work with it. The following is the exception I get. Something really strange is going on here. > > org.apache.commons.configuration.ConfigurationException: Unable to parse the configuration file > at org.apache.commons.configuration.plist.XMLPropertyListConfiguration.load(XMLPropertyListConfiguration.java:247) > at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration$FileConfigurationDelegate.load(AbstractHierarchicalFileConfiguration.java:443) > at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:356) > at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:322) > at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:285) > at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:217) > at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:195) > at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.load(AbstractHierarchicalFileConfiguration.java:164) > at ConfigTester.main(ConfigTester.java:13) > Caused by: java.net.MalformedURLException > at java.net.URL.(URL.java:601) > at java.net.URL.(URL.java:464) > at java.net.URL.(URL.java:413) > at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:968) > at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:905) > at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:872) > at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:282) > at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:1021) > at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) > at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) > at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) > at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) > at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) > at org.apache.commons.configuration.plist.XMLPropertyListConfiguration.load(XMLPropertyListConfiguration.java:243) > ... 8 more > > Any ideas or suggestions? > Thanks. > > > > ----- Original Message ---- >> From: "simon.kitching@chello.at" >> To: Jakarta Commons Users List >> Sent: Friday, February 15, 2008 4:51:40 AM >> Subject: Re: Commons Configuration >> >> > The > org.apache.crimson > parser > *is* > the > default > parser > for > java > 1.4. > It >> was > only > in > 1.5 > that > they > moved > to > Xerces. >> The > question > is > whether > this > is >> (a) > something > in > the > input > that > crimson > just > doesn't > handle, > or >> (b) > something > in > the > way > that > Configuration > is > setting > up > the > xml > parser >> that > crimson > doesn't > like >> The > best > test > would > be > to > try > to > process > "test.plist.xml" > directly > with >> crimson, > eg > just > read > it > and > count > the > number > of > elements. > If > that >> doesn't > work, > then > there > isn't > much > that > Configuration > can > do > about > it. >> Regards, >> Simon > > > > > > > ____________________________________________________________________________________ > Looking for last minute shopping deals? > Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org