Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser

前端 未结 19 2130
清酒与你
清酒与你 2020-12-10 01:32

I\'m trying to display my reports on the browser , but I keep getting this error:

\"enter

相关标签:
19条回答
  • 2020-12-10 02:07

    A little late, but here is why we had this problem... We recently started developing with IntelliJ instead of Eclipse. We simply forgot to run IntelliJ as administrator... We had done this with Eclipse for a long time already, but simply didn't think about it with IntelliJ. In the end, I guess the fonts weren't found or a folder was not found since there were insufficient rights to read/write on the c drive.

    0 讨论(0)
  • 2020-12-10 02:07

    You can try make a downgrade to jdk7, it's works to me.

    sorry my english!

    0 讨论(0)
  • 2020-12-10 02:08

    This is a missing jars in the class path issue.

    I had this issue and found that with by adding the missing jars to the class path it resolved the issue.

    From the below article java.dzone.com article I found that the minimal jars necessary are...Now The versions numbers have changed but with these libraries only I managed to get it working.

    • jasperreports-2.0.4.jar
    • commons-digester-1.7.jar
    • commons-collections-2.1.jar (commons-collections.jar)
    • commons-logging-1.0.2.jar
    • commons-beanutils.jar
    • iText-2.0.7.jar (used infor PDF exporting)
    0 讨论(0)
  • 2020-12-10 02:09

    Got the same error - apparently JRStyledTextParser is using dependency from xml-apis By adding xml-apis I got it fixed

    <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <version>1.4.01</version>
    </dependency>
    
    0 讨论(0)
  • 2020-12-10 02:11

    For those still running into this issue: on Ubuntu Server 12.04 with headless OpenJDK JRE, it was simply solved by

    apt-get install ttf-dejavu-extra
    
    0 讨论(0)
  • 2020-12-10 02:14

    To resolve the issue, do the following:

    1. Switched from Open JDK to Sun JDK
    2. Installed MS Core Fonts
    3. Packaged JasperReport font library jar with the application
    0 讨论(0)
提交回复
热议问题