Solved

jasper reports gets NoClassDefFoundError

Posted on 2014-03-04
2
1,667 Views
Last Modified: 2014-03-04
I get the following error.  I know it is likely a missing jar file, but I have all of the listed prerequisites.  Here are the details:

java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
      at net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory.<clinit>(ComponentsExtensionsRegistryFactory.java:110)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:247)
      at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:157)
      at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:115)
      at net.sf.jasperreports.engine.util.ClassUtils.instantiateClass(ClassUtils.java:53)
      at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.instantiateRegistry(DefaultExtensionsRegistry.java:237)
      at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:214)
      at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:162)
      at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getRegistries(DefaultExtensionsRegistry.java:133)
      at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:105)
      at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:83)
      at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:123)
      at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88)
      at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103)
      at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61)
      at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179)
      at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:108)
      at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653)
      at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:569)
      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:915)
      at ca.specialtysoftware.jpar.reports.ReportFileIO.fillReport(ReportFileIO.java:147)
      at ca.specialtysoftware.jpar.reports.ReportFileIO.saveJasperPrint(ReportFileIO.java:95)
      at ca.specialtysoftware.jpar.reports.ReportFileIO.saveJasperPrint(ReportFileIO.java:79)
      at ca.specialtysoftware.jpar.business.tasks.BuildClaimsDetailTask.doInBackground(BuildClaimsDetailTask.java:131)
      at javax.swing.SwingWorker$1.call(SwingWorker.java:278)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at javax.swing.SwingWorker.run(SwingWorker.java:317)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:619)


Here are the class libraries that I have included in my project:
JAXP_150.jar
commons-beanutils-1.9.1.jar
commons-collections-2.1.1.jar
commons-logging-1.1.1.jar
commons-javaflow-1209105.jar
commons-digester3-3.2.jar
commons-codec-1.5.jar
itext-2.1.3.jar
poi-3.2-FINAL.jar
jfreechart-1.0.7.jar
jxl-2.6.12.jar
jasperreports-5.5.1.jar
jasperreports-applet-5.5.1.jar
jasperreports-font-5.5.1.jar
jasperreports-javaflow-5.5.1.jar
servlet-api-2.4.jar

These other jar files that should be unrelated are there as well
toplink-essentials-agent.jar
RelativeLayout.jar
xercesImpl-2.9.1.jar
MySQL-connector-java-5.1.6-bin.jar
ostermillerutils_1_07_00.jar


This is jasperreports 5.5.1 obviously.  If anyone has it working for a stand-alone java program and can compare my situation with their working one, I would appreciate it.
0
Comment
Question by:geekdad1
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
geekdad1 earned 0 total points
ID: 39904838
Solved it.  When you download apache commons digester library make sure that you do not get the (most recent) digester3 version, get the digester-2.1 version.  They are not the same.
0
 
LVL 1

Author Closing Comment

by:geekdad1
ID: 39904842
I hate giving myself the points, but I did solve it, and I think this should be posted since other developers seem to have similar problems with jasperreports.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now