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

David Tolpin dvd at renderx.com
Fri Jul 11 09:20:21 PDT 2003


Uwe,


Magci call com.renderx.sax.XMLReaderFactory:

  org.xml.sax.XMLReader xmlreader=com.renderx.sax.XMLReaderFactory.createXMLReader();

XMLReaderFactory tries a number of way to load the right XMLReader, namely

    try {
      try {
        xmlreader=javax.xml.parsers.SAXParserFactory.newInstance().newSAXParser().getXMLReader();
      } catch(Exception e) { // ParserConfigurationException, but if I write it here, the class will not be loaded
        throw new org.xml.sax.SAXException("cannot create SAX2 parser: "+e);
      }
    } catch(Error e) { // no jaxp
      try {
        xmlreader=org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
      } catch(Error e1) {
        xmlreader=new org.xml.sax.helpers.ParserAdapter();
      }
    }

As a result, an instance of org.xml.sax.XMLReader is returned. 

Magic then passes com.renderx.sax.InputSource("resource:com/renderx/util/magic.xml") to the xml reader
for parsing. com.renderx.sax.InputSource catches resource: protocol and calls setByteStream on the
resource.

A conforming parser should use the open byte stream and not try to retrieve it since bytestream is set.

Your parser evidently ignores that and tries to reconnect to the URL.

To find out what parser is loaded, execute

System.err.println("xmlreader class is "+com.renderx.sax.XMLReaderFactory.createXMLReader().getClass());

By the way, why are you still using XEP 3.04? Since you have the license key,
you can use it to download the current version.

David
> 
> Hello,
> 
> once we try to integrate XEP 3.04 client into our application for testing
> purposes we get the following error message:
> "com.renderx.util.Magic:java.net.MalformedURLException: unknown protocol:
> resource"
> and XEP exits. (I have learned that "resource" is an internal protocol used
> by RenderX, e.g "resource:com/renderx/util/magic.xml")
> 
> Does anyone know why this problem occurs? Any kind of help is highly
> appreciated!
> 
> Thanks in advance
> 
> Uwe GЖrsch
> 
> 	Uwe GЖrsch
> 	Consultant
> 
> 	Lufthansa Systems Business Solutions GmbH
> 	HAM AM/D
> 	Sportallee 54 a
> 	22335 Hamburg
> 	Germany
> 
> 	Tel  +49 40 5070 1938
> 	Fax +49 40 5070 4611
> 	mailto:uwe.goersch at lhsystems.com
> 	http://www.LHsystems.com
> 
> 
> 
> -------------------
> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
> in the body of the message to majordomo at 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
> 
> 

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at 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



More information about the Xep-support mailing list