0

I'm using jasperreports6.11.0 and commons-collections4-4.4. When i run the application im getting this error

java.lang.NoClassDefFoundError: org/apache/commons/collections4/map/ReferenceMap 

I have library in classpath and im running the application through batch and I also included it in the classpath in batchfile.

I have tried various common collection versions (4.0, 4.1, 4.2, 4.3, 4.4, 3.2.2) and error still exists

michaeak
  • 1,548
  • 1
  • 12
  • 23
nik
  • 19
  • 4
  • Does this answer your question? [java.lang.NoClassDefFoundError: org/apache/commons/collections/Transformer](https://stackoverflow.com/questions/28778191/java-lang-noclassdeffounderror-org-apache-commons-collections-transformer) – michaeak Feb 17 '20 at 15:06
  • 1
    @michaeak's comment explains why version 3.2.2 does not work, the packages `org.apache.commons.collections4` don't exist before version 4. But at least version 4.4 does contain that `ReferenceMap` class. Thus, you apparently do not have that version in the applicable class path. – mkl Feb 17 '20 at 15:10
  • Jasper Reports relies on which version? The idea is that you might have some version conflict. How do you build your code? With maven? How do you run your code? In other words: jasper reports relies on some apache-commons version and your code relies on some other apache commons and thus there might be a clash. Please provide a stack trace of the exception too to help others to understand the problem better. – michaeak Feb 17 '20 at 15:11
  • If I see correctly jasper reports depends on apache common bean utils 1.9.4 which depends on commons collections 3.2.2 https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils/1.9.4 – michaeak Feb 17 '20 at 15:18
  • and jasper reports also depends on apache commons collections 4.2 https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6.11.0 – michaeak Feb 17 '20 at 15:20
  • thank you guys .how to know which jars are compatable ? is it trail and error we need to follow or is there any way to find it?i didn't find any of this related in documentation. – nik Feb 17 '20 at 15:23
  • i have tried using these jars commons-collections4-4.4 , commons-beanutils-1.9.4,commons-digester3-3.2,Jasper Reports 6.11.0 and i still get this error 2020/02/17/09:55:20 : Exception in generate jasper report....Error occurred in server thread; nested exception is: java.lang.NoClassDefFoundError: org/apache/commons/collections4/map/ReferenceMap – nik Feb 17 '20 at 15:56
  • If you want answers you need to answer questions, because the question is how you build and how you run ... – michaeak Feb 17 '20 at 17:03
  • im using ant and im running my application through batch file – nik Feb 17 '20 at 19:46

0 Answers0