Clarity

Expand all | Collapse all

Jaspersoft Text Field Cannot be Displayed

Jump to Best Answer
  • 1.  Jaspersoft Text Field Cannot be Displayed

    Posted 09-25-2017 11:36 PM

    Hi there,

    with Jaspersoft 6.2.1 and Linux, I suddenly have problems to render any pixel perfect report, being OOTB or custom.

    The stack trace is the following:

     

    ERROR AsyncJasperPrintAccessor,pool-6-thread-16:315 [myOrganization|myUser] - Error during report execution
    java.lang.ArrayIndexOutOfBoundsException: 0
    at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:75)
    at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93)
    at sun.font.Font2D.getFontMetrics(Font2D.java:415)
    at java.awt.Font.defaultLineMetrics(Font.java:2176)
    at java.awt.Font.getLineMetrics(Font.java:2246)
    at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.determineLeading(SimpleTextLineWrapper.java:390)
    at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.getGeneralFontInfo(SimpleTextLineWrapper.java:342)
    at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.createFontInfo(SimpleTextLineWrapper.java:278)
    at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.start(SimpleTextLineWrapper.java:240)
    at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:536)
    at net.sf.jasperreports.engine.util.JdkGlyphFixTextMeasurer.measure(JdkGlyphFixTextMeasurer.java:141)
    at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:672)
    at net.sf.jasperreports.engine.fill.JRFillTextField.prepare(JRFillTextField.java:820)
    at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:352)
    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:421)
    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:396)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:317)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:251)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:119)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:559)
    at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:119)
    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$SynchronousExecutor.execute(EngineServiceImpl.java:923)
    at net.sf.jasperreports.engine.fill.BaseFillHandle.startFill(BaseFillHandle.java:164)
    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$AsynchronousReportFiller.fillReport(EngineServiceImpl.java:879)
    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1775)
    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runWithDataSource(EngineServiceImpl.java:1119)
    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1048)
    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:945)
    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DiagnosticLoggingContextCompatibleExecutorService$1.run(DiagnosticLoggingContextCompatibleExecutorService.java:61)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

     

    I have found similar posts in the Jaspersoft Community, but with no results:

    https://community.jaspersoft.com/questions/1065376/error-when-executing-reports-jasperserver
    https://community.jaspersoft.com//questions/527879/pdf-rendering-depends-server-environment

     

    As this seem to be related to the font in use (I have tried SansSerif and Arial), I hope that there is the change that the fonts can be added to the OS?

     

    Thank you very much for any hint!

     

    Regards

    Georg



  • 2.  Re: Jaspersoft Text Field Cannot be Displayed

    Posted 09-26-2017 01:47 AM

    Hi Georg,

     

    Did this ever worked before? 

     

    Regards

    Suman Pramanik 



  • 3.  Re: Jaspersoft Text Field Cannot be Displayed

    Posted 09-27-2017 06:54 AM

    Hi Suman,

     

    yes, it had worked before but somehow got affected by an update to the OS - at least that is what the logs suggest.

    In the meantime, following community post pointed us to using the font "DejaVu Sans" instead of "Arial" or "Sans Serif":

    PDF Rendering Depends on Server Environment | Jaspersoft Community 

     

    As a result, the custom reports are running again with the new font, but all the OOTB reports are failing.

     

    As the web is full of people with problems using fonts in Java and Jaspersoft, I am hopeful that this is a general problem someone already has a solution for.

     

    Thanks

    Georg



  • 4.  Re: Jaspersoft Text Field Cannot be Displayed

    Posted 09-27-2017 07:56 AM

    Can you ask the OS admin to install the fonts and see if that helps 



  • 5.  Re: Jaspersoft Text Field Cannot be Displayed

    Posted 09-29-2017 09:01 AM

    Hi Suman,

     

    do you mean we have to install the fonts in Jaspersoft or in the OS directly?

     

    Thanks and regards

    Georg



  • 6.  Re: Jaspersoft Text Field Cannot be Displayed
    Best Answer

    Posted 09-30-2017 01:13 PM

    Hi Georg,

     

    Please install the fonts at the OS layer.

     

    Regards

    Suman Pramanik



  • 7.  Re: Jaspersoft Text Field Cannot be Displayed

    Posted 10-04-2017 06:39 AM

    Hi Suman,

     

    thank you so much, it worked

     

    Regards

    Georg



  • 8.  Re: Jaspersoft Text Field Cannot be Displayed

    Posted 10-04-2017 08:59 AM

    Hi Georg,

     

    You are most welcome. 

     

    Regards

    Suman Pramanik 



  • 9.  Re: Jaspersoft Text Field Cannot be Displayed

    Posted 10-10-2017 01:23 PM

    Hi all,

     

    in the meantime, I found the root cause in the Jaspersoft community:

    java - Upgrade RHEL from 7.3 to 7.4: ArrayIndexOutOfBoundsException in sun.font.CompositeStrike.getStrikeForSlot - Stack… 

     

    I would be happy if anyone shared his/her experiences with this issue and if it only applied to the described combination of RHEL 7.4 and openJDK 1.8.0.141 or if there are even more system setups affected by the issue.

     

    Regards

    Georg