简体   繁体   中英

Exception “java.lang.AbstractMethodError: org.codehaus.groovy.control.CompilationUnit$ClassgenCallback.call(Lorg/objectweb/asm/ClassVisitor;)V"

I am using Jasper Reports and am using following libraries in my class path

jasperreports-4.5.1.jar
common-digester3-3.2.jar
common-digester2.1.jar
castor-1.2.jar
commons-beanutils-1.8..0.jar
commons-collections-2.1.1.jar
commons-logging-1.1.1.jar
groovy-1.2.6.jar
asm-3.1.jar
antlr-3.3.1.1.jar
jtds-1.2.5.jar

I got the following exception

   Exception in thread "AWT-EventQueue-0" java.lang.AbstractMethodError: org.codehaus.groovy.control.CompilationUnit$ClassgenCallback.call(Lorg/objectweb/asm/ClassVisitor;Lorg/codehaus/groovy/ast/ClassNode;)V
at org.codehaus.groovy.control.CompilationUnit$14.call(CompilationUnit.java:776)   org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes                                                                                                                          at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:501)
    at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport
at net.sf.jasperreports.engine.JasperCompileManager.compileReport)
at Utilities.ReportDriver.runReport(ReportDriver.java:81)
at jewelleryerpapplication.GUI.MainReports.jbtnViewReportActionPerformed
at jewelleryerpapplication.GUI.MainReports.access$100(MainReports.java:18)
at jewelleryerpapplication.GUI.MainReports$2.actionPerformed(MainReports.java:210)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased
 at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege
at java.security.ProtectionDomain$1.doIntersectionPrivilege
at java.awt.EventQueue$4.run(EventQueue.java:680)
at java.awt.EventQueue$4.run(EventQueue.java:678)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege
at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
at java.awt.EventDispatchThread.pumpOneEventForFilters
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

on executing the following code:

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, param, jdbcConnection); JasperViewer.viewReport(jasperPrint);

What have I done wrong? How can I fix this or debug it further?

I had a similar error message.

It wasn't depending on the ASM, but on the used groovy library groovy-xxxjar .

Beware - You have to use the groovy-all-xxxjar in order to get this work.

It's exactly the same thing as in your other question here: Exception "java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter" on Viewing Jasper Report

The answer is the same. You need to find the right ASM version that will satisfy all your dependencies on it, which may involve changing the versions of some of your other libraries, too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM