-----BEGIN PGP SIGNED MESSAGE----- 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:
<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 java.io.File object.
However, when later on my program attempts to resovle this into either an AbsoluteFilePath through java.io.File.getAbsoluteFile() or a CanonicalFilePath file path through java.io.File.getCanonicalFile() I get a null pointer exception similar to what is shown below:
Exception in thread "main" java.lang.NullPointerException ~ at java.io.UnixFileSystem.resolve(UnixFileSystem.java:92) ~ at java.io.UnixFileSystem.resolve(UnixFileSystem.java:118) ~ at java.io.File.getCanonicalPath(File.java:513) ~ at java.io.File.getCanonicalFile(File.java:534)
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." -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBrbFJi75r3xx6ZPYRAhnoAJ45pSPCUKO01Ac4trbZs601klOcsACdE7hJ iEDS07sjDGp+HXZs7gNugdc= =eTG7 -----END PGP SIGNATURE-----
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
