Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

jasper reports gets NoClassDefFoundError

Posted on 2014-03-04
2
Medium Priority
?
1,838 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

886 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