You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Ch...@partner.bmw.de on 2005/01/26 08:24:46 UTC

How to force Batik to use the Xerxes Parser when transforming from SVG to JPEG?

Hi,

I've written a simple java-application which converts svg-files to jpeg files
using the batik transcoder api. 
It works fine when I test it locally.
But when deploying it on the server (bea) I get the following error:

java.io.IOException: SAX2 driver class org.apache.crimson.parser.XMLReaderImpl not found
	at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:353)
	at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:276)
	at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:158)
	at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:231)
	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:118)

I used    System.setProperty("javax.xml.parsers.SAXParserFactory",
                   "org.apache.xerces.jaxp.SAXParserFactoryImpl");
in order to force the processor to use Xerxes and not Crimson, but the error still remains.

Can someone give me a hint how to solve this problem?

Thank you Christian












---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: How to force Batik to use the Xerxes Parser when transforming from SVG to JPEG?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Christian,

    First off the default parser for Batik has been
Xerces for a very long time.  I really only mention this
because since then there have been many improvements in Batik.

    The problem is that Batik doesn't use JAXP to pick it's
parser (JAXP didn't exist when Batik was written).  The
way to change the parser is to modify or override the
file:

     org/apache/batik/util/resources/XMLResourceDescriptor.properties

    You can either modify the one in batik (located under
xml-batik/resources) or add one to your classpath ahead of
the one included in 'batik-util.jar'.

Christian.Stark@partner.bmw.de wrote:

> I've written a simple java-application which converts svg-files to jpeg files
> using the batik transcoder api. 
> It works fine when I test it locally.
> But when deploying it on the server (bea) I get the following error:
> 
> java.io.IOException: SAX2 driver class org.apache.crimson.parser.XMLReaderImpl not found
> 	at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:353)
> 	at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:276)
> 	at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:158)
> 	at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:231)
> 	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:118)
> 
> I used    System.setProperty("javax.xml.parsers.SAXParserFactory",
>                    "org.apache.xerces.jaxp.SAXParserFactoryImpl");
> in order to force the processor to use Xerxes and not Crimson, but the error still remains.
> 
> Can someone give me a hint how to solve this problem?
> 
> Thank you Christian
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org