Menu

JasperReports Compilation fails

Help
Ivan Popov
2008-02-29
2019-09-12
  • Ivan Popov

    Ivan Popov - 2008-02-29

    Hi all,

    I stumbled upon a problem I can't figure out.
    I made a report and bundled it into webApp.ear, which I deployed on the jboss server.
    From a Linux client machine the report looks perfect. No matter if I use desktop client or JNLP shortcut, it always appears correctly.
    On a Windows client the report appears rarely (I cannot explain why just sometimes, I can say only that when I empty the Temp folder and it stops to show up). Most of the time (no matter if it is on the desktop client or jnlp) it throws the following exception:

    ...
    17:06:40.717 ReportStarter.httpDownloadedReport:  report deployed to http://192.168.2.101:8080/webApp/Availability_Period.jrxml [14]

    17:06:40.748 ReportStarter.processReport: reportFile.getAbsolutePath() = C:\DOCUME~1\TODOR_~1\LOCALS~1\Temp\Availability_Period.jrxml [14]

    17:06:40.748 ReportStarter.JWScorrectClassPath: Classpath has been corrected to C:\Program Files\Java\jre1.5.0_12\lib\deploy.jar;C:/Documents%20and%20Settings/todor_lulov/Application%20Data/Sun/Java/Deployment/cache/javaws/http/D192.168.2.101/P8080/DMadmin/DMadempiereHome/RMCompiereJasperReqs.jar [14]

    ===========> ReportStarter.compileReport: JRException; e.getMessage()= Errors were encountered when compiling report expressions class file:
    C:\Documents and Settings\todor_lulov\Desktop\Availability_Period_1204297601982_995050.java:4: package net.sf.jasperreports.engine does not exist

    import net.sf.jasperreports.engine.*;

    ^

    C:\Documents and Settings\todor_lulov\Desktop\Availability_Period_1204297601982_995050.java:5: package net.sf.jasperreports.engine.fill does not exist

    import net.sf.jasperreports.engine.fill.*;

    ^

    C:\Documents and Settings\todor_lulov\Desktop\Availability_Period_1204297601982_995050.java:14: package net.sf.jasperreports.engine does not exist

    import net.sf.jasperreports.engine.*;

    ^

    C:\Documents and Settings\todor_lulov\Desktop\Availability_Period_1204297601982_995050.java:15: package net.sf.jasperreports.engine.data does not exist

    import net.sf.jasperreports.engine.data.*;

    ^

    C:\Documents and Settings\todor_lulov\Desktop\Availability_Period_1204297601982_995050.java:21: cannot find symbol

    symbol: class JREvaluator

    public class Availability_Period_1204297601982_995050 extends JREvaluator

                                                                  ^

    C:\Documents and Settings\todor_lulov\Desktop\Availability_Period_1204297601982_995050.java:28: cannot find symbol

    symbol  : class JRFillParameter

    location: class Availability_Period_1204297601982_995050

        private JRFillParameter parameter_REPORT_RESOURCE_BUNDLE = null;

                ^
    ....

    I tried to debug with eclipse, but both on Windows and Linux the report always appeared so I never met the error condition. I can't understand why ADempiere's ReportStarter class can't see the JasperReports compiler. The RMCompiereJasperReqs.jar package is right in place.

    Any ideas?

    Regards,
    jp

     
    • Ivan Popov

      Ivan Popov - 2008-03-06

      Hi, all,

      Finally I found a quick fix for my issue (but dirty also).
      Since on Windows ADempiere couldn't find its package for report compilation, I just put it into a predefined directory on the client machine (that means I'll have to do it for every other Windows machine added to the stack of clients in the future) and just hard coded this directory as addition to the classpath in the

      org.compiere.report.ReportStarter.JWScorrectClassPath()

      method. In order to be at least a bit correct I put this changed class into the customization.jar and I use it this way.

      By the way I noticed another issue when trying to build webApp.ear with my reports. When I try to run the JasperReportsWebApp/build.xml as an ANT build from eclipse, the build fails for following reason:

      Buildfile: /home/adempiere/workspace/adempiere321/JasperReportsWebApp/build.xml
      xdoclet:
           [echo] ------ Executing xdoclet
      compile:
           [echo] ------ Compiling webApp
          [javac] Compiling 6 source files to /home/adempiere/workspace/adempiere321/JasperReportsWebApp/build
          [javac] /home/adempiere/workspace/adempiere321/JasperReportsWebApp/src/org/compiere/ejb/MD5Bean.java:17: package org.compiere.util does not exist
          [javac] import org.compiere.util.CLogger;

      ...

      I have put the packages in order (in the Build Path) like specified in:
      http://www.adempiere.com/wiki/index.php/Create_your_ADempiere_development_environment#Compile_ADempiere_sources (in 3)
      so what might be the reason that the CLogger class is not visible there?
      I guess I'll figure out that too sooner or later.

      Regards,
      jp

       
  • Sandro Nakaguma

    Sandro Nakaguma - 2019-09-12

    Hi,

    Any updates on the existence of import org.compiere.util?

    Thanks in advance.

     

Log in to post a comment.