user1058036
user1058036

Reputation: 333

NullPointerException in Jasper Reports?

When I export a report using jasper report (version 1.2.4), it throws NPE. And I cant find any solution to the problem online. Can anyone help me in this regard please?

If I remove one problematic column in my report and export it, it exports fine. Couldn't find whats the problem with that column as it contains large data.

Many Thanks in Advance !

Posting the exception below :

java.lang.NullPointerException|

at java.awt.font.TextLayout.getBaselineFromGraphic(Unknown Source)|

at java.awt.font.TextMeasurer.initAll(Unknown Source)|

at java.awt.font.TextMeasurer.<init>(Unknown Source)|

at java.awt.font.LineBreakMeasurer.<init>(Unknown Source)|

at java.awt.font.LineBreakMeasurer.<init>(Unknown Source)|

at net.sf.jasperreports.engine.fill.TextMeasurer.renderParagraph(TextMeasurer.java:259)|

at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:220)|

at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:528)|

at net.sf.jasperreports.engine.fill.JRFillTextField.prepare(JRFillTextField.java:501)|

at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:345)|

at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:311)|

at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:275)|

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1291)|

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:631)|

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:248)|

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:132)|

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:750)|

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:666)|

at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)|

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)

Upvotes: 1

Views: 1474

Answers (2)

Hakanai
Hakanai

Reputation: 12670

You can get the exact same error using pure JRE code, like this:

@Test
public void testText()
{
    String text = "\uFFFF\u0300";
    JTextArea textArea = new JTextArea(text);
    JOptionPane.showMessageDialog(null, textArea);
}

Because of this, I have been assuming it's a JRE bug and already submitted it to Oracle. The workaround is presumably to cull whatever character sequence is causing it, but I obviously don't know what you are feeding in.

Upvotes: 2

uckelman
uckelman

Reputation: 26224

This is likely either (1) a bug in the version of the JRE you're using, or (2) a threading bug. We've had the same top five lines in stack traces in a project I work on.

Upvotes: 0

Related Questions