我已将Jasperstudio 6.1.1插件包含在我的日食中。我已将以下罐子包含在我的库中。
当我尝试执行一个独立的java类时,我得到了跟随错误。我认为错误是因为我的公共版本,但不知道如何找到确切的版本。
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap
at net.sf.jasperreports.engine.design.JRAbstractJavaCompiler.<clinit>(JRAbstractJavaCompiler.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at net.sf.jasperreports.engine.JasperCompileManager.getCompiler(JasperCompileManager.java:823)
at net.sf.jasperreports.engine.JasperCompileManager.getEvaluator(JasperCompileManager.java:380)
at net.sf.jasperreports.engine.fill.JRFillDataset.createCalculator(JRFillDataset.java:467)
at net.sf.jasperreports.engine.fill.BaseReportFiller.<init>(BaseReportFiller.java:152)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:236)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:72)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:60)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:201)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:216)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:85)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:456)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:417)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:838)
at id.hans.employee.application.MainApplication.showReport(MainApplication.java:59)
at id.hans.employee.application.MainApplication.main(MainApplication.java:83)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.map.ReferenceMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 20 more
答案 0 :(得分:1)
我刚刚找到解决方案。问题出在commons-collect版本上。我把它升级到commons-collection-3.2.1.jar并且它有效。感谢