Jump to content
We've recently updated our Privacy Statement, available here ×
  • "path cannot be empty" error when exporting report to PDF format


    vchiem
    • Features: Exporters, JasperReports Server, Reports Version: v7 Product: JasperReports® Server

    Issue:

    For certain reports that was created in TIBCO Jaspersoft® Studio and published to the TIBCO JasperReports® Server, there is a failure when exporting to PDF format.

    The error that is displayed on the browser page is:

    There was an error on the server. Try again or contact site administrators. (Error UID: 7f214198-72c8-46e0-9fbf-85042cd192f9)

    and the jasperserver.log file captures the error "java.lang.IllegalArgumentException: path cannot be empty" :

    2021-08-06T07:05:26,901 ERROR SecureExceptionHandlerImpl,https-jsse-nio-443-exec-9:116 - There was an error on the server. Try again or contact site administrators. (Error UID: 7f214198-72c8-46e0-9fbf-85042cd192f9)
    2021-08-06T07:05:26,902 ERROR ErrorPageHandlerAction,https-jsse-nio-443-exec-9:118 - Error UID 7f214198-72c8-46e0-9fbf-85042cd192f9 java.lang.IllegalArgumentException: path cannot be empty
        at com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.util.RepositoryUtils.resolveRelativePath(RepositoryUtils.java:138)
        at com.jaspersoft.jasperserver.api.engine.jasperreports.util.RepoRepositoryService.getInputStream(RepoRepositoryService.java:112)
        at net.sf.jasperreports.repo.StreamRepositoryService.getInputStream(StreamRepositoryService.java:43)
        at net.sf.jasperreports.repo.InputStreamPersistenceService.load(InputStreamPersistenceService.java:51)
        at net.sf.jasperreports.repo.InputStreamPersistenceService.load(InputStreamPersistenceService.java:41)
        at com.jaspersoft.jasperserver.api.engine.jasperreports.util.RepoRepositoryService.getResource(RepoRepositoryService.java:182)
        at net.sf.jasperreports.repo.RepositoryService.getResource(RepositoryService.java:50)
        at net.sf.jasperreports.repo.RepositoryUtil.findInputStream(RepositoryUtil.java:195)
        at net.sf.jasperreports.repo.RepositoryUtil.getBytesFromLocation(RepositoryUtil.java:211)
        at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:2749)

    Exporting the report/s to any other format works fine.

     


    Solution:

    The cause of the issue is a reference to a PDF Font that is invalid. 

    In TIBCO Jaspersoft® Studio, navigate to the Source tab and search for any invalid entries relating to pdfFontName attribute.

    For example, the main report or subreport contains a style tag that has an empty reference to pdfFontName like this:

    <style mode="Opaque" forecolor="#FFFFFF" backcolor="#B42314" pdfFontName="">

    which is causing the "path cannot be empty"  error.

    Remove this invalid entry and publish the report to the TIBCO JasperReports® Server before attempting an export of the report to PDF format.


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...