[#9476] - Local report unit using scriptlet throws java.lang.NoClassDefFoundError when language = groovy, not with language = java

Category:
Bug report
Priority:
High
Status:
New
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

I have a local report unit using scriptlet that throws java.lang.NoClassDefFoundError when language = groovy, not with language = java

My environment is: JSS 6.3.1, Windows 10 x64, java.version=1.8.0_92 (Java HotSpot(TM) 64-Bit Server VM)

There is a similar bug at: http://community.jaspersoft.com/jaspersoft-studio/issues/8446, but nothing solved until now.

The stacktrace is:

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during class generation: java.lang.NoClassDefFoundError: Unable to load class org.sescam.ati.explotacion.mxxireport.MxxiJrUtil due to missing dependency net/sf/jasperreports/engine/JRScriptletException

java.lang.RuntimeException: java.lang.NoClassDefFoundError: Unable to load class org.sescam.ati.explotacion.mxxireport.MxxiJrUtil due to missing dependency net/sf/jasperreports/engine/JRScriptletException
at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1091)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1069)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:102)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:203)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:294)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:146)
at net.sf.jasperreports.eclipse.builder.JasperReportsBuilder.compileJRXML(JasperReportsBuilder.java:220)
at com.jaspersoft.studio.editor.action.CompileAction.actionCompile(CompileAction.java:142)
at com.jaspersoft.studio.editor.action.CompileAction$1.run(CompileAction.java:93)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NoClassDefFoundError: Unable to load class org.sescam.ati.explotacion.mxxireport.MxxiJrUtil due to missing dependency net/sf/jasperreports/engine/JRScriptletException
at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:391)
at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:265)
at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1004)
at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:999)
at org.codehaus.groovy.ast.ClassNode.getSuperClass(ClassNode.java:993)
at org.codehaus.groovy.ast.ClassNode.isDerivedFrom(ClassNode.java:936)
at org.codehaus.groovy.classgen.asm.InvocationWriter.castToNonPrimitiveIfNecessary(InvocationWriter.java:858)
at org.codehaus.groovy.classgen.asm.OperandStack.doConvertAndCast(OperandStack.java:347)
at org.codehaus.groovy.classgen.asm.OperandStack.doGroovyCast(OperandStack.java:282)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitCastExpression(AsmClassGenerator.java:741)
at org.codehaus.groovy.ast.expr.CastExpression.visit(CastExpression.java:87)
at org.codehaus.groovy.classgen.asm.CallSiteWriter.prepareSiteAndReceiver(CallSiteWriter.java:235)
at org.codehaus.groovy.classgen.asm.CallSiteWriter.prepareSiteAndReceiver(CallSiteWriter.java:224)
at org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:272)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCachedCall(InvocationWriter.java:307)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:392)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:104)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeInvokeMethodCall(InvocationWriter.java:88)
at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:459)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:767)
at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:66)
at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluateEqual(BinaryExpressionHelper.java:316)
at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.eval(BinaryExpressionHelper.java:84)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitBinaryExpression(AsmClassGenerator.java:638)
at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:607)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeExpressionStatement(OptimizingStatementWriter.java:357)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGenerator.java:620)
at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:84)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeBlockStatement(OptimizingStatementWriter.java:158)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:566)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:288)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeIfElse(StatementWriter.java:299)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeIfElse(OptimizingStatementWriter.java:280)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitIfElse(AsmClassGenerator.java:582)
at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:43)
at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:84)
at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeBlockStatement(OptimizingStatementWriter.java:158)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:566)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:104)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:115)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:430)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:387)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:126)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:507)
at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1086)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:53)
at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:233)
at org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:813)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1055)
... 11 more

v6.3.1
mlopez_1's picture
904
Joined: Oct 21 2013 - 8:08am
Last seen: 3 weeks 3 days ago

8 Comments:

#1

Could you add a sample? I have to reproduce it.

#2

Here we go the example.

The rar file has tree files:

- MxxiJrUtil_2.java: source file for java scritlet
- org.sescam.ati.explotacion.mxxireport_2.jar: jar file ready to use as a scriptlet
- PROBAR_MXXIJRUTIL_LOCAL.jrxml: jrxml file with Language = groovy that throws compilation errors
- JSS-GroovyScriptletError.png: error screenshot from JSS.

Regards,

Mariano

AttachmentSize
File _groovyscriptleterror.rar190.11 KB
#3

Here is another example with start to finish steps: http://community.jaspersoft.com/questions/1052861/groovy-fails-simplest-...

#4

Bug still present on version 6.6.0

And I can't anymore edit the query and use "read fields", nor add a dataset,
because there is a check on the report, which fails with :

startup failed:
calculator_BL_1534845693376_257461: 18: unable to resolve class net.sf.jasperreports.compilers.GroovyEvaluator

#5

Workaround here :
https://stackoverflow.com/questions/8935925/why-do-i-get-compilation-err...

replace /plugins/groovy-all_2.4.5.jar with groovy-all-2.4.15.jar ....

#6

Worked the same as the comment #5.
Be careful trying with version 2.5.x of groovy, breaked my JStudio 7.1 installation on MacOS.
2.4.15 version is good.

Thanks damien.chambe

#7

Works well with groovy-all-2.4.15.jar in this environment: JSS 6.6.0, Windows 10 x64, java.version=1.8.0_171 (Java HotSpot(TM) 64-Bit Server VM).

Just updating groovy jar for the next release will resolve the problem.

Thanks,

Mariano

#8

The same problem with JaspersoftStudio6.6.0. Environment: Windows10, java=1.8.0u171.
A report works well when plugins\groovy-all_2.4.5.jar is updated to groovy-all-2.4.15.jar version. (also works with groovy-all-2.4.10.jar)

Feedback
randomness