Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling jasper reports from java

 
Sneha Jaiswal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sneha Jaiswal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic