commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Moynihan <>
Subject Re: [digester] & resolving relative paths to canonical/absolute file paths
Date Wed, 01 Dec 2004 12:28:55 GMT
Hash: SHA1

on 12/01/04 11:55 Rick Moynihan said the following:
| Hi all,
| I'm using The Commons Digester to parse some XML and it all works fine.
| ~ I have some XML of the form:
| <object>
| ~        <path>../relative/file/path</path>
| </object>
| Digester works perfectly and I can put the relative path (as specified
| inside the <path> tags) into a object.
| However, when later on my program attempts to resovle this into either
| an AbsoluteFilePath through or a
| CanonicalFilePath file path through I
| get a null pointer exception similar to what is shown below:
| Exception in thread "main" java.lang.NullPointerException
| ~        at
| ~        at
| ~        at
| ~        at
| Some experimenting seems to have got me closer to the error, as I have
| found that "pre digestion", i.e. prior to a call to
| org.apache.commons.digester.Digester.parse(fileToParse)
| System.getProperty("user.dir") returns a correct value (the path to the
| directory where my JVM was instantiated).
| However post digestion, and indeed during it,
| System.getProperty("user.dir") ALWAYS returns null.
| I was led to believe that this system property was read-only.  I have
| found this error occurs in both java v1.4.2-b28 and tiger (java v1.5).
| It appears that digester or one of its dependencies is somehow reseting
| the "user.dir" property.  Is this a bug in Digester?  Has anybody else
| experienced anything like this.
| Can anybody offer some help?
| Rick.
| p.s. I'd like to say: "Thanks to all the Apache developers, all the
| projects I've run across have been excellent."

You should all disregard this... Some code of mine was reseting the
System properties rather than appending a set of new properties to it.
It's all thankfully resolved now...

Again thanks to the Apache teams for some excellent OSS work!


- ---------------------------------------------------------------------
To unsubscribe, e-mail:
For additional commands, e-mail:

Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message