Batik with grails giving sax clash

北城余情 提交于 2019-12-05 14:15:21

The issue seems to be that Batik includes a version of xml-apis that clashes with the one now included in the JDK. (http://grails.1312388.n4.nabble.com/Problems-integrating-batik-with-grails-project-td4632728.html) So, it's a matter of excluding 'xml-apis' as you have done already. However, since so many of Batik's jars have transitive dependencies on xml-apis, it is hard to get Grails to exclude it. Here's what eventually worked for me:

compile("org.apache.xmlgraphics:fop:0.94",
            "org.apache.xmlgraphics:batik-transcoder:1.7",
            "org.apache.xmlgraphics:batik-codec:1.7",
            "org.apache.xmlgraphics:batik-awt-util:1.7",
            "org.apache.xmlgraphics:batik-bridge:1.7",
            "org.apache.xmlgraphics:batik-dom:1.7",
            "org.apache.xmlgraphics:batik-gvt:1.7",
            "org.apache.xmlgraphics:batik-svg-dom:1.7",
            "org.apache.xmlgraphics:batik-svggen:1.7",
            "org.apache.xmlgraphics:batik-util:1.7",
            "org.apache.xmlgraphics:batik-xml:1.7",
            "org.apache.xmlgraphics:batik-anim:1.7",
            "org.apache.xmlgraphics:batik-css:1.7",
            "org.apache.xmlgraphics:batik-ext:1.7",
            "org.apache.xmlgraphics:batik-js:1.7",
            "org.apache.xmlgraphics:batik-parser:1.7",
            "org.apache.xmlgraphics:batik-script:1.7",
            "org.apache.xmlgraphics:xmlgraphics-commons:1.2",
            "commons-logging:commons-logging:1.0.4",
            "org.apache.avalon.framework:avalon-framework-api:4.3.1",
            "org.apache.avalon.framework:avalon-framework-impl:4.3.1",
            "xalan:xalan:2.6.0",
            "xml-apis:xml-apis-ext:1.3.04"
    ){
        transitive = false
    }

This is basically a whitelist of the Batik jars I want to include. Since transitive = false, transitive dependencies are ignored.

However, I still can't actually get Batik to work - there seems to be a secondary issue where org.apache.batik.dom.svg.SVGOMDocument is missing even though the required jars which contain that class are deployed in my war.

Did you find another working solution?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!