Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 79806 invoked from network); 20 Dec 2005 15:55:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Dec 2005 15:55:14 -0000 Received: (qmail 91311 invoked by uid 500); 20 Dec 2005 15:55:02 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 91233 invoked by uid 500); 20 Dec 2005 15:55:01 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 91203 invoked by uid 99); 20 Dec 2005 15:55:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Dec 2005 07:55:01 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [64.95.232.36] (HELO mail02.roncap.com) (64.95.232.36) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Dec 2005 07:55:00 -0800 Received: (qmail 17968 invoked by uid 46); 20 Dec 2005 15:54:39 -0000 Received: from william.evans@ronin-capital.com by mail02.roncap.com by uid 502 with qmail-scanner-1.21st (spamassassin: 2.63. Clear:RC:1(10.97.1.103):. Processed in 0.021531 secs); 20 Dec 2005 15:54:39 -0000 Received: from sron-chi-exc03.ronin.roncap.com (10.97.1.103) by sron-chi-mail02.ronin.roncap.com with SMTP; 20 Dec 2005 15:54:39 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: XMLConfiguration load problem - External Entity not found Date: Tue, 20 Dec 2005 09:54:39 -0600 Message-ID: <768C2A98E8A50F48BD8EE964A8014AD80322D7@sron-chi-exc03.ronin.roncap.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: XMLConfiguration load problem - External Entity not found Thread-Index: AcYFfDsKqvG/XUo+Rpu92EyICBXLugAABouA From: "William Evans" To: "Jakarta Commons Users List" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Oliver, Here is my code fragment: try { XMLConfiguration config =3D new XMLConfiguration(); String base =3D System.getProperty("user.dir"); config.setBasePath(base); config.setFileName("DirectorWithSingleAssistant.xml"); config.load(); // ..... ... =20 } catch (Exception e) { fail(e.toString()); } And my XML: Sorry to bother you, but another problem has come up also: While to parsing the file, it doesn't seem to recognize structured properties as advertised in the 'XML - How to'. For example, with XML: When I iterate: for (Iterator iter =3D config.getKeys(); iter.hasNext();) { String key =3D (String) iter.next(); String value =3D config.getString(key); System.out.println(key + " =3D " + value); } I get: =09 Families.Family[@name] =3D ES Families.Family.X[@a] =3D a Families.Family.X[@b] =3D b And I am unable to access, as I'd hoped, via: Families.Family(0)[@name], etc... Anything obvious? Many thanks for your help. Bill -----Original Message----- From: Oliver Heger [mailto:oliver.heger@t-online.de]=20 Sent: Tuesday, December 20, 2005 7:44 AM To: Jakarta Commons Users List Subject: Re: XMLConfiguration load problem - External Entity not found William Evans wrote: >I am using 'commons-configuration-1.2.jar' to make it easier to read XML >configuration files. > >=20 > >The files are not terribly complex but do have associated DTDs. Ideally >I would like to specify the DTD location using a local, relative path. >The problem is that when I try and load the file, I get: > >=20 > >Relative URI "../../../yyyy.dtd"; can not be resolved without a base >URI. > >=20 > >So, after reading about a similar problem with solution posted by >Oliver, I tried specifying the full path. Now I get: > >=20 > >External entity not found: >"file://C:/eclipse/workspace/xxxx/dtds/yyyyy.dtd".=20 > >=20 > >Or... > >=20 > >External entity not found: "C:/eclipse/workspace/xxxx/dtds/yyyyy.dtd". > >=20 > >What is up here? Is the use of DTDs not really supported? In the article >I found, Oliver said that he had fixed the relative path problem. Is >there some other issue going on? > >=20 > >Any help much appreciated... > >=20 > >Bill > > =20 > Could you please provide a code fragment how you setup and load your XMLConfiguration instance? And full stack traces of exceptions might be useful, too. The mentioned fix should be in 1.2. There is a unit test that tests loading a document that refers to a local DTD. But maybe not all posibilities are covered? Oliver --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org