JasperReports 6.7.0 uses Apache Commons Collections 3.2.2 but Apache POI 3.15 requires Apache Commons Collections 4.1 as you can see here:
https://search.maven.org/classic/remotecontent?filepath=org/apache/poi/poi/3.15/poi-3.15.pom
There is the same problem with Apache Commons Logging.
As Apache Commons Collections 3.2.2 and Apache Commons Collections 4.1 use distinct package names, replacing the JAR of the former by the one of the latter isn't enough, the source code of JasperReports itself requires to be modified to use the same classes and the same package names of Apache Commons Collections than Apache POI:
java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap
at net.sf.jasperreports.engine.component.ComponentsEnvironment.(ComponentsEnvironment.java:56)
at net.sf.jasperreports.engine.component.ComponentsEnvironment.getInstance(ComponentsEnvironment.java:76)
at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.getSchemaLocations(JRReportSaxParserFactory.java:103)
at net.sf.jasperreports.engine.xml.BaseSaxParserFactory.configureParser(BaseSaxParserFactory.java:163)
at net.sf.jasperreports.engine.xml.BaseSaxParserFactory.createParser(BaseSaxParserFactory.java:118)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createParser(JRXmlDigesterFactory.java:1597)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:1566)
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.compileToFile(JasperCompileManager.java:253)
at net.sf.jasperreports.ant.JRAntCompileTask.compile(JRAntCompileTask.java:402)
at net.sf.jasperreports.ant.JRAntCompileTask.execute(JRAntCompileTask.java:249)
As a consequence, JasperReports 6.7.0 can't work with Apache POI 3.15 as is.
Recommended Comments