Jump to content
We've recently updated our Privacy Statement, available here ×

Error when JasperCompileManager.compileReport(jasperDesign)


xujin_helen

Recommended Posts

Hi,

I am using Eclipse Helios with Jaspersoft Studio 1.1.1. I was able to create a report and pull data from Java Bean with Bean Factory. When preview, it successfully show data in the report (only two String fields). Also I noticed that it will compile when you go to preview tab and click run the report.

However, when I use Java to compile and generate report, first it throws "Exception in thread "main" java.lang.NoClassDefFoundError: "; if I include groovy-all-1.7.5.jar in the library, it throws below exception. I searched this forum, and one discussion (http://community.jaspersoft.com/questions/539433/netsfjasperreportsenginejrexception-errors-were-encountered-when-compiling-report) seems has similar problem as mine. However, my report only include two String fields (in Java  Bean, they are String also). I also attach my source code here.

 

Errors were encountered when compiling report expressions class file:

org.codehaus.groovy.control.MultipleCompilationErrorsException

calculator_Blank32A4_1342030798799_371391: 13: unable to resolve class net.sf.jasperreports.expressions.functions.LogicalFunctions

@ line 13, column 1.

calculator_Blank32A4_1342030798799_371391: 14: unable to resolve class net.sf.jasperreports.expressions.functions.TextFunctions

@ line 14, column 1.

calculator_Blank32A4_1342030798799_371391: 15: unable to resolve class net.sf.jasperreports.expressions.functions.MathFunctions

@ line 15, column 1.

calculator_Blank32A4_1342030798799_371391: 16: unable to resolve class net.sf.jasperreports.expressions.functions.DateTimeFunctions

@ line 16, column 1.

calculator_Blank32A4_1342030798799_371391: 13: unable to resolve class net.sf.jasperreports.expressions.functions.LogicalFunctions

@ line 13, column 1.

calculator_Blank32A4_1342030798799_371391: 14: unable to resolve class net.sf.jasperreports.expressions.functions.TextFunctions

@ line 14, column 1.

calculator_Blank32A4_1342030798799_371391: 15: unable to resolve class net.sf.jasperreports.expressions.functions.MathFunctions

@ line 15, column 1.

calculator_Blank32A4_1342030798799_371391: 16: unable to resolve class net.sf.jasperreports.expressions.functions.DateTimeFunctions

@ line 16, column 1.

8 errors

: startup failed:

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi, 
the missing classes are related to the new functions library introduced for the new expression library.
Please have a look at the following issue in the tracker: #5771.

Summarizing, you should include the needed jars if you make use of the functions in one or more of your expressions.
However as far as I can understand you don't use them. So for now when you compile the report via Java (outside JSS) remove the static imports from jrxml.
So this rows:

    <import value="static net.sf.jasperreports.expressions.functions.LogicalFunctions.*"/>
    <import value="static net.sf.jasperreports.expressions.functions.TextFunctions.*"/>
    <import value="static net.sf.jasperreports.expressions.functions.MathFunctions.*"/>
    <import value="static net.sf.jasperreports.expressions.functions.DateTimeFunctions.*"/>

Starting from the next release, Jaspersoft Studio 1.1.2, there will be a flag to add/remove these static imports when saving the JRXML available in the JSS preference page. 

Best regards,
Massimo.
 

Link to comment
Share on other sites

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...