David H. DeWolf wrote:
> see:
>
> http://svn.apache.org/repos/asf/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java
Aha! That got me going again.
(What follows is not really a Pluto problem, since it arises from an
incompatibility of the combination of httpunit/servletunit and
javax.xml.parsers running on Windows, but I'm doumenting it here in case
anyone knows of a quick fix. I'll then try and figure how to report it
properly.)
Unfortunately, my subsequent travails have landed me at a bug in
javax.xml.parsers.DocumentBuilder, thus:
[[
/**
* Parse the content of the given file as an XML document
* and return a new DOM [EMAIL PROTECTED] Document} object.
* An <code>IllegalArgumentException</code> is thrown if the
* <code>File</code> is <code>null</code> null.
*
* @param f The file containing the XML to parse.
* @exception IOException If any IO errors occur.
* @exception SAXException If any parse errors occur.
* @see org.xml.sax.DocumentHandler
* @return A new DOM Document object.
*/
public Document parse(File f) throws SAXException, IOException {
if (f == null) {
throw new IllegalArgumentException("File cannot be null");
}
String uri = "file:" + f.getAbsolutePath();
if (File.separatorChar == '\\') {
uri = uri.replace('\\', '/');
}
InputSource in = new InputSource(uri);
return parse(in);
}
]]
The rules used here for constructing a file URI are incorrect when run
on Windows, as a filename of the form D:\example.ext ends up being a URI
file:D:/example.ext, which ends up throwing a malformed URI exception
[1]. The actual exception occurs deep in some code that I can't trace.
I'm not familiar with the procedures for reporting/pathching javax
problems, but I'll go have a dig.
#g
--
[1] per RFC 3986 [http://www.ietf.org/rfc/rfc3986.txt], appendix A, this
is legitimate URI syntax. (Also with the earlier spec, RFC2396.) But
it is not correct use of the file: URI scheme as an absolute pathname,
and the correct URI here would be 'file:/D:/example.ext' or
'file:///D:/example.ext'
--
Graham Klyne
For email:
http://www.ninebynine.org/#Contact