I found the cause of the problem.  I had a dependency that was bringing in
fop:fop transitively but that wasn't required in my application.  Once I
added that exclusion then I found I needed the following for batik.  I
removed some batik dependencies that did not seem needed for SVG -> PNG
conversion...there may be more optimizations that can be made.

The key to finding this was to use the dependency:tree goal to see exactly
what the dependencies actually are.

<!--batik-->
            <dependency>
                <groupId>org.apache.xmlgraphics</groupId>
                <artifactId>batik-rasterizer</artifactId>
                <version>${batik.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.xmlgraphics</groupId>
                        <artifactId>fop</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>xalan</groupId>
                        <artifactId>xalan</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.xmlgraphics</groupId>
                <artifactId>batik-codec</artifactId>
                <version>${batik.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.xmlgraphics</groupId>
                        <artifactId>batik-bridge</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

-Dave




On Fri, May 31, 2013 at 1:10 PM, David Hoffer <dhoff...@gmail.com> wrote:

> I added...
>
>  <dependency>
>             <groupId>crimson</groupId>
>             <artifactId>crimson</artifactId>
>         </dependency>
>
> And that got me past this issue but then XML parsing breaks in other parts
> of the app/build. So I can't use this.
>
> What's the right way to add support for converting SVGs to PNGs that adds
> the minimum number of dependencies to my build?  I'd like to not add any
> XML parser...just use the JDK if possible.
>
> -Dave
>
>
> On Fri, May 31, 2013 at 8:43 AM, David Hoffer <dhoff...@gmail.com> wrote:
>
>> I'm trying to use batik-rasterizer to convert some SVGs to PNGs but I get
>> the following runtime error.
>>
>> java.io.IOException: SAX2 driver class
>> org.apache.crimson.parser.XMLReaderImpl not found
>>
>> I have the following in my maven build, what else do I need?
>>
>> <dependency>
>>             <groupId>org.apache.xmlgraphics</groupId>
>>             <artifactId>batik-rasterizer</artifactId>
>>             <version>1.7</version>
>> </dependency>
>>
>>
>>
>

Reply via email to