2

我正在使用 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);

我做错了什么?我该如何解决这个问题或进一步调试它?

4

2 回答 2

4

我有一个类似的错误信息。

它不依赖于 ASM,而是依赖于使用的 groovy 库groovy-x.x.x.jar

当心- 您必须使用groovy-all-x.x.x.jar才能完成这项工作。

于 2012-11-28T13:04:42.267 回答
1

这与您在此处的其他问题完全相同: Exception "java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter" on Viewing Jasper Report

答案是一样的。您需要找到合适的 ASM 版本来满足您对它的所有依赖关系,这也可能涉及更改其他一些库的版本。

于 2012-04-26T05:03:31.410 回答