我正在使用Jasper Reports并在我的类路径中使用以下库
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
我收到了以下异常
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)
执行以下代码:
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,param,jdbcConnection); JasperViewer.viewReport(jasperPrint);
我做错了什么?我该如何解决这个问题或进一步调试呢?
答案 0 :(得分:4)
我有类似的错误消息。
它不依赖于ASM,而是取决于使用的groovy库groovy-x.x.x.jar
。
小心 - 您必须使用groovy-all-x.x.x.jar
才能完成这项工作。
答案 1 :(得分:1)
这与你在其他问题中完全相同: Exception "java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter" on Viewing Jasper Report
答案是一样的。您需要找到能够满足所有依赖关系的正确ASM版本,这可能涉及更改某些其他库的版本。