File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes calling jasper reports from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "calling jasper reports from java" Watch "calling jasper reports from java" New topic
Author

calling jasper reports from java

Sneha Jaiswal
Greenhorn

Joined: Dec 08, 2008
Posts: 2
hi all! I'm having a problem with calling jasper reports from my java application. I used iReport to create the jrxml report file and then wrote the necessay code to call it from my java app. I have imported the necessary packages and added the required jar files to my project classpath. I dont get any errors when compiling. But when i run the application and try to call the report, i get the following error:
"java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
at net.sf.jasperreports.engine.JasperCompileManager.
compileReport(JasperCompileManager.java:150)"
Am using netbeans6.1 and latest version of ireport.

I am confused since the commons/digester jar file has been added in the classpath. What am i doing wrong. please help me out. thanks.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi sj and welcome to Javaranch!

Firstly, can you please change your name in accordance to our naming policy.

Onto your question, can you post your CLASSPATH here? We might be able to spot a typo or some such


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Sneha Jaiswal
Greenhorn

Joined: Dec 08, 2008
Posts: 2
Well,Martijn, as I said, I'm using Netbeans and so I added the zip files to my project classpath by right-clicking on it, choosing Properties->Libraries and specifying the respective paths under Compile tab.
These are the zip files I added:

commons-beanutils-1.8.0-bin.zip
commons-collections-3.2.1-bin.zip
commons-digester-1.8.zip
commons-logging-1.1.1-bin.zip
jasperreports-3.1.2.jar
xercesImpl.jar.zip

Am I correct in doing so?
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hmm, I don't use Netbeans but a couple of questions:

1.) Are you running program from within Netbeans?

2.) Is adding zip files to the CLASSPATH in Netbeans legitimate? I tend to add JAR files in Eclipse as opposed to zip.
 
GeeCON Prague 2014
 
subject: calling jasper reports from java