----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Apache does nothing to restrict file access. Your JVM has the same rights
running from the command line as it does when Apache starts it (it may be
run in a slightly different environment, different login).
I just looked at my code and it does the exact same thing. One small change
that shouldn't effect anything is I use:
parser.parse(new InputSource("c:\xyz.xml"));
The only reason I do that is because XMLParser.parse(String) is deprecated.
Your problem probably is something to do with the environment or login.
Check file access, etc.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of jason harrop
Sent: Wednesday, March 01, 2000 4:30 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: SAX entity resolution in servlets
----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Hi
In an application, I can use Xerces to do something like:
xmlFile = "file:///home/harry/fastcar/Jaguar.xml"
DOMParser parser = new DOMParser();
parser.parse(xmlFile);
But in a servlet, I can't.. Instead of file i have to stick it where
apache can see it and use http, thus:
xmlFile = "http://127.0.0.1/xml/jaguar.xml
:
Similarly, the path to the DTD must be specified with http, not file.
Can anyone explain why please? i've attached the exception below
i'm running JServ 1.1 and xerces 1.0.2 under Linux
cheers,
jason harrop
=============
org.xml.sax.SAXParseException: File
"file:///home/harry/fastcar/Jaguar.xml" not found.
at org.apache.xerces.framework.XMLParser.reportError(Compiled
Code)
at
org.apache.xerces.framework.XMLParser.startReadingFromDocument(Compiled
Code)
at org.apache.xerces.framework.XMLParser.parseSomeSetup(Compiled
Code)
at org.apache.xerces.framework.XMLParser.parse(Compiled Code)
at org.apache.xerces.framework.XMLParser.parse(Compiled Code)
at ParseXMLServlet.doGet(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jserv.JServConnection.processRequest(Compiled
Code)
at org.apache.jserv.JServConnection.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]