Despite the question asked before, I cannot solve the problem by using them. I am currently trying to generate pdf file via using the jasper report.However, I always get an exception related with the jar dependencies. Despite, I add following jars file into my build path,
program generates me class not found exception either related with collections. My main goal is via using jrxml file generate a pdf. I am using iReport 5.6.0 to generate jrxml file. Any help is appreciated. The Stack trace of error is below;
Generating PDF...
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap
at net.sf.jasperreports.engine.component.ComponentsEnvironment.<init>(ComponentsEnvironment.java:57)
at net.sf.jasperreports.engine.component.ComponentsEnvironment.getInstance(ComponentsEnvironment.java:86)
at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.getSchemaLocations(JRReportSaxParserFactory.java:99)
at net.sf.jasperreports.engine.xml.BaseSaxParserFactory.configureParser(BaseSaxParserFactory.java:162)
at net.sf.jasperreports.engine.xml.BaseSaxParserFactory.createParser(BaseSaxParserFactory.java:117)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createParser(JRXmlDigesterFactory.java:1572)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:1541)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:263)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:219)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:194)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:185)
at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:288)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:575)
at com.tutorialsdojo.jasper.HelloJasper.main(HelloJasper.java:13)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.map.ReferenceMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 14 more
I manage to solve problem and I want to share the answer in order to help the community. The jar dependencies can be gathered via the pom.xml. However, the easy way relies on the iReport (jrxml generated version) installed folder. There is a folder in the location Jaspersoft\iReport-x.x.x\ireport\modules\ext (depends on OS). You can get the following jar files from there;
Then all problems are gone. Hope this helps to other user who meets the problem.
Regards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With