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

Groovy scriptlet - IllegalAccessError problem


walter_gillett

Recommended Posts

I am experimenting with Groovy scriptlets using JasperReports 3.6.2/Java 1.5/Groovy 1.6.5 on MacOS. As a start, I created a Groovy scriptlet class that inherits from JRDefaultScriptlet and for now does nothing. Next I compiled the .groovy file using groovyc. Then I changed my existing, working report template to reference the new scriptlet class. When I try to run the report, I get this error:

Error filling print... java.lang.IllegalAccessError: tried to access field org.codehaus.groovy.reflection.CachedClass.EMPTY from class org.codehaus.groovy.reflection.ClassInfo null

See the full backtrace below. There's some reflection happening that is blowing up mysteriously. Any ideas?

Here's the backtrace:

Error filling print... java.lang.IllegalAccessError: tried to access field org.codehaus.groovy.reflection.CachedClass.EMPTY from class org.codehaus.groovy.reflection.ClassInfo null
java.lang.IllegalAccessError: tried to access field org.codehaus.groovy.reflection.CachedClass.EMPTY from class org.codehaus.groovy.reflection.ClassInfo
    at org.codehaus.groovy.reflection.ClassInfo.<init>(ClassInfo.java:48)
    at org.codehaus.groovy.reflection.ClassInfo$LocalMap.<clinit>(ClassInfo.java:329)
    at org.codehaus.groovy.reflection.ClassInfo$ThreadLocalMapHandler.initialValue(ClassInfo.java:377)
    at org.codehaus.groovy.reflection.ClassInfo$ThreadLocalMapHandler.initialValue(ClassInfo.java:373)
    at java.lang.ThreadLocal$ThreadLocalMap.getAfterMiss(ThreadLocal.java:374)
    at java.lang.ThreadLocal$ThreadLocalMap.get(ThreadLocal.java:347)
    at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:225)
    at java.lang.ThreadLocal.get(ThreadLocal.java:127)
    at org.codehaus.groovy.reflection.ClassInfo$ThreadLocalMapHandler.get(ClassInfo.java:391)
    at org.codehaus.groovy.reflection.ClassInfo.getClassInfo(ClassInfo.java:98)
    at poseur.bi.ParticipationSummaryReportScriptlet.$getStaticMetaClass(ParticipationSummaryReportScriptlet.groovy)
    at poseur.bi.ParticipationSummaryReportScriptlet.<init>(ParticipationSummaryReportScriptlet.groovy)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at net.sf.jasperreports.engine.scriptlets.DefaultScriptletFactory.getScriptlet(DefaultScriptletFactory.java:109)
    at net.sf.jasperreports.engine.scriptlets.DefaultScriptletFactory.getScriplets(DefaultScriptletFactory.java:69)
    at net.sf.jasperreports.engine.fill.JRFillDataset.createScriptlets(JRFillDataset.java:461)
    at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:578)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1246)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:877)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:826)
    at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:59)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:858)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Print not filled. Try to use an EmptyDataSource...
 

 

 

 

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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