You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Paul Austin <pa...@galdosinc.com> on 2002/09/25 20:40:47 UTC

log4j with xerces 2.1.0

All,

With xerces 2.1.0 the DOMConfigurator class fails to load the XML file as it
cannot find the log4j.dtd.

Looking into this I saw that the original code was setting a systemId on the
InputSource for the document. Further investigation has shown that this is
used if the input source does not have a reader or input stream not instead
of using the dtd system id. (i.e. This would only be used to load the XML
document not the dtd).

The correct way to do this is to add an entity resolver which will look at
either the systemId or the publicId and return an input source for the dtd.
I have modified the DOMConfigurator to remove the old code and add the new
Log4jEntityResolver class which will return the dtd for log4j. I would
propose that this class be extended in the future to support a well known
public id for the configuration files as well.

Can someone add this to cvs for the project

Paul Austin
Galdos Systems Inc.�
paustin@galdosinc.com
Tel: +1 (604) 484-2761
Fax: +1 (604) 484-2755
http://www.galdosinc.com/

Privileged or confidential information may be contained in this message. If
this message was not intended for you, destroy it and notify us immediately.
Opinions, conclusions, recommendations, and other information presented in
this message are not given or necessarily endorsed by my employer or firm.


RE: log4j with xerces 2.1.0

Posted by Paul Austin <pa...@galdosinc.com>.
Mark,

Yes it should be backwards compatible as this is the standard way in JAXP to
look up resources using either a public or system id.

The resolver class can also be extended if you wanted to support a public id
like the following to look up the DTD.

-//Apache Software Group//DTD Log4j 1.4//EN

Paul

-----Original Message-----
From: mwomack@apache.org [mailto:mwomack@apache.org]
Sent: September 25, 2002 10:43 PM
To: Log4J Developers List
Subject: RE: log4j with xerces 2.1.0


Hi Paul,

Appreciate the patch submission.  Your fix is backward compatible with
earlier versions of xerces?

thanks,
-Mark

> -----Original Message-----
> From: Paul Austin [mailto:paustin@galdosinc.com]
> Sent: Wednesday, September 25, 2002 11:41 AM
> To: log4j-dev@jakarta.apache.org
> Subject: log4j with xerces 2.1.0
>
>
> All,
>
> With xerces 2.1.0 the DOMConfigurator class fails to load the XML
> file as it
> cannot find the log4j.dtd.
>
> Looking into this I saw that the original code was setting a
> systemId on the
> InputSource for the document. Further investigation has shown that this is
> used if the input source does not have a reader or input stream
> not instead
> of using the dtd system id. (i.e. This would only be used to load the XML
> document not the dtd).
>
> The correct way to do this is to add an entity resolver which will look at
> either the systemId or the publicId and return an input source
> for the dtd.
> I have modified the DOMConfigurator to remove the old code and add the new
> Log4jEntityResolver class which will return the dtd for log4j. I would
> propose that this class be extended in the future to support a well known
> public id for the configuration files as well.
>
> Can someone add this to cvs for the project
>
> Paul Austin
> Galdos Systems Inc.™
> paustin@galdosinc.com
> Tel: +1 (604) 484-2761
> Fax: +1 (604) 484-2755
> http://www.galdosinc.com/
>
> Privileged or confidential information may be contained in this
> message. If
> this message was not intended for you, destroy it and notify us
> immediately.
> Opinions, conclusions, recommendations, and other information presented in
> this message are not given or necessarily endorsed by my employer or firm.
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: log4j with xerces 2.1.0

Posted by mw...@apache.org.
Hi Paul,

Appreciate the patch submission.  Your fix is backward compatible with
earlier versions of xerces?

thanks,
-Mark

> -----Original Message-----
> From: Paul Austin [mailto:paustin@galdosinc.com]
> Sent: Wednesday, September 25, 2002 11:41 AM
> To: log4j-dev@jakarta.apache.org
> Subject: log4j with xerces 2.1.0
>
>
> All,
>
> With xerces 2.1.0 the DOMConfigurator class fails to load the XML
> file as it
> cannot find the log4j.dtd.
>
> Looking into this I saw that the original code was setting a
> systemId on the
> InputSource for the document. Further investigation has shown that this is
> used if the input source does not have a reader or input stream
> not instead
> of using the dtd system id. (i.e. This would only be used to load the XML
> document not the dtd).
>
> The correct way to do this is to add an entity resolver which will look at
> either the systemId or the publicId and return an input source
> for the dtd.
> I have modified the DOMConfigurator to remove the old code and add the new
> Log4jEntityResolver class which will return the dtd for log4j. I would
> propose that this class be extended in the future to support a well known
> public id for the configuration files as well.
>
> Can someone add this to cvs for the project
>
> Paul Austin
> Galdos Systems Inc.™
> paustin@galdosinc.com
> Tel: +1 (604) 484-2761
> Fax: +1 (604) 484-2755
> http://www.galdosinc.com/
>
> Privileged or confidential information may be contained in this
> message. If
> this message was not intended for you, destroy it and notify us
> immediately.
> Opinions, conclusions, recommendations, and other information presented in
> this message are not given or necessarily endorsed by my employer or firm.
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>