Solved

jasper reports gets NoClassDefFoundError

Posted on 2014-03-04
2
1,712 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
servlet requestdispatcher include and forward differences 1 39
diffSum example 4 53
by zero exception 10 53
learn programming 8 43
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

820 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