Re: [xep-support] MalformedURLException in com.renderx.util.Magic

From: Nikolai Grigoriev (grig@renderx.com)
Date: Thu Jul 17 2003 - 09:01:11 PDT

  • Next message: Jooyong_Lee@omb.eop.gov: "[xep-support] EPS Images"

    Uwe,

    > It seems, once "com.renderx.sax.InputSource" is instantiated with
    > "resource:com/renderx/util/magic.xml" it seems to return this string with
    > "getSystemId()".

    > The XMLReader (here Saxon, but essentially Xerces seems to do the same)
    then
    > tries to create a "java.net.URL" with this string
    > "resource:com/renderx/util/magic.xml" and this throws a
    > MalformedURLException.

    Saxon is an XSLT transformer; it can work with any SAX parser.
    JAR file for Saxon 6.5.2 includes a SAX parser, Aelfred; but
    it is not picked automatically. If your system is configured
    to use Xerces as its default JAXP parser, it will continue to
    do so regardless of the presence/absence of SAXON in the classpath.

    (Note also that the failure occurs on reading internal configuration
    files. This is done by a pure parser: no need to call XSLT processor
    at this stage).

    > Should "getSystemId()" on "com.renderx.sax.InputSource" yield this
    > ("resource:com/renderx/util/magic.xml") result or a different result? Is
    > there an error in our configuration?

    Yes; and we believe there is nothing wrong with this. System ID
    is just a label; if the InputSource provides a byte stream, there
    is no reason for the parser to convert it to java.net.URL. In this
    particular case, the contents of the URL is a classpath; the data
    are retrieved from the class loader using getResourceAsStream()
    function.

    > Any further help is highly appreciated!

    My suggestions:

    1) Determine which class is called to parse configuration
    files. Please execute the following two lines of code in
    the context of your system, just before or after call to XEP:

    XMLReader reader = com.renderx.sax.XMLReaderFactory.createXMLReader();
    System.err.println(reader.getClass().getName());

    2) If the parser is Xerces, try to replace it with something else
    by specifying the implementation class for the JAXP parser factory
    in the following system property:

    javax.xml.parsers.SAXParserFactory =
          com.icl.saxon.aelfred.SAXParserFactoryImpl

    (The settings above are for SAXON's built-in AElfred)

    Please check that the change actually took place, by controlling
    the parser's class name.

    3) If everything above fails to repair the situation, the only method
    is to move XML configuration files from XEP Jars to explicit
    locations in the local filesystem. To do this, you will have to extract
    com/renderx/util/magic.xml from xep****.jar, save it somewhere
    and specify its location in a system property. The same procedure
    should be repeated for two more files.

    The last method is a nec plus ultra solution, to adopt only in
    extreme cases. If switching the parser to AElfred does not repair
    the situation, please drop me a note off-list to support@renderx.com;
    I will send you detailed istructions for getting rid of "resource:/"
    calls.

    Best regards,
    Nikolai Grigoriev
    RenderX

    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



    This archive was generated by hypermail 2.1.5 : Thu Jul 17 2003 - 09:01:03 PDT