grails – java. lang.ClassNotFoundException:org. apache. batik. dom. svg. SVGOMDocument

Pay attention to many questions and answers about using batik. I can't fix my mistakes. I can't find anything that may help And this question has no answer

My problem is that when I download the PDF of my application, an error occurs (I even try to include jar):

java.lang.ClassNotFoundException: org.apache.batik.dom.svg.SvgoMDocument

In my Jasper report, I have included:

<image>
    <reportElement x="453" y="117" width="246" height="115"/>
        <imageExpression class="net.sf.jasperreports.engine.JRRenderable"><![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstance(new java.io.File("C:\\Project\\myProject\\web-app\\images\\tomcat.svg"))]]>
        </imageExpression>
</image>

Basically, my buildconfig Groovy is like this:

inherits("global") {
    excludes 'xml-apis','xml-apis-ext','xercesImpl'
}

And my dependence:

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

Why can't I download it? Invalid SVG? I got this SVG from wiki

Solution

Check that your deployment code has batik-svg-dom-1.7 Jar or batik-all-1.7 Jar (using this will shorten the compilation configuration) If missing, please add it manually to see if your problem has been fixed If it is missing, but something is missing in the deployment configuration

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>