commons-user mailing list archives

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

Hi all,

I'm using The Commons Digester to parse some XML and it all works fine.
~ I have some XML of the form:

~        <path>../relative/file/path</path>

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
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?


p.s. I'd like to say: "Thanks to all the Apache developers, all the
projects I've run across have been excellent."
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


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

View raw message