Solved

jasper reports gets NoClassDefFoundError

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
difference of if loops 23 49
javap not working 8 45
How to convert String matching to regex in java 4 33
null output 3 25
I'd like to talk about something that is near and dear to my heart: build systems. Without them, building software is all about compiling locally, with software versions everywhere. It can be a mess. Today we are going to discuss building a small di…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

770 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