Unable to generate the pdf

0

Hi All,

I keep on getting the following error while generating a pdf in linux server where as it's working fine in my local machine.

java.lang.ExceptionInInitializerError
        at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:124)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:89)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:104)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62)
        at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179)
        at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:108)

Caused by: net.sf.jasperreports.engine.JRRuntimeException: java.io.IOException: Problem reading font data.
        at net.sf.jasperreports.engine.fonts.SimpleFontFace.setTtf(SimpleFontFace.java:182)
        at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFace(SimpleFontExtensionHelper.java:368)
 Caused by: java.io.IOException: Problem reading font data.
        at java.awt.Font.createFont0(Font.java:999)
        at java.awt.Font.createFont(Font.java:876)
 

I have tried all the solutions that I could fine on the web like

-  Give permissions to temp directory of the tomcat

- Set the java.awt.headless property to true

- Add the jasper-fonts library to the lib folder and use only the "DejaVu Sans" font in all my reports.

None of the solutions worked and now I need help from Jasper specialists.

 

After I see this issue for the very first time while populating the pdf and second time onwards I am getting the following exception

 

java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
        at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:124)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:89)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:104)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62)
 

Any help would be much appreciated.. Thank you.

 

rajalapati's picture
Joined: Jun 15 2014 - 10:34pm
Last seen: 5 years 1 month ago

2 Answers:

0

If you're using 5.5.0, there's a bug with using external fonts. Upgrade to 5.6.0

hozawa's picture
45109
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 month 1 week ago
0

I got the same problem on newer version 5.6.0

net.sf.jasperreports.engine.JRRuntimeException: java.io.IOException: Problem reading font data.

Would appreciate any advice or suggestions Thank you.

kermit18's picture
Joined: Aug 5 2014 - 5:10am
Last seen: 4 years 11 months ago
Feedback
randomness