Java – when using batik in webapp on tomcat, “sax2 driver class org.apache.crimson.parser.xmlreaderimpl not found”

This may be related to the classpath problem, but I'm not sure yet because I don't have this error on some machines

The error at the top of the stack is that the sax2 driver class org. Is not found apache. crimson. parser. XMLReaderImpl. Why do I only get this error in some environments and not others? How can I further investigate and / or solve this problem?

Environmental Science:

>Jetty on MAC or PC = = OK > Tomcat 5 or 6 on MAC = = OK > Tomcat 5 or 6 on Win XP = = error > Tomcat 6 on CentOS = = error

Version in POM:

>Batik: batik: jar: 1.5: compile > net sf. Saxon: Saxon: jar: 8.7: compile > batik: batik transcoder: jar: 1.6-1: compile

>Batik: batik bridge: jar: 1.6-1: compile > batik: batik GVT: jar: 1.6-1: compile > batik: batik AWT util: jar: 1.6-1: compile > batik: batik util: jar: 1.6-1: compile > batik: batik GUI util: jar: 1.6-1: compile > batik: batik ext: jar: 1.6-1: compile > XML APIs: xmlparserapis: jar: 2.0 2: Compile > batik: batik script: jar: 1.6-1: compile > batik: batik SVG DOM: jar: 1.6-1: compile > batik: batik DOM: jar: 1.6-1: compile > batik: batik CSS: jar: 1.6-1: compile > batik: batik XML: jar: 1.6-1: compile > batik: batik parser: jar: 1.6-1: compile > FOP: FOP: jar: 0.20 5: Compile > batik: batik-1.5-fop: jar: 0.20-5: compile > XML APIs: XML APIs: jar: 1.0 b2:compile > xalan:xalan:jar:2.4. 1: Compile > Xerces: xercesimpl: jar: 2.2 1: Compile > Avalon framework: Avalon framework: jar: 4.0: compile

Solution

Thank you. It's very useful

There is exactly the same "lack of crimson" on win 7 / Tomcat 6 It is implemented by adding a crimson library, but the performance is poor and very slow Transcoding a single image takes about 10-15 seconds Finally, the problem is solved by deleting the FOP you described. Now it's really fast This is my performance in POM:

<dependency>
        <groupId>batik</groupId>
        <artifactId>batik-transcoder</artifactId>
        <version>1.6-1</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <artifactId>fop</artifactId>
                <groupId>fop</groupId>
            </exclusion>
        </exclusions>
    </dependency>
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
分享
二维码
< <上一篇
下一篇>>