File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes getting error: JasperReport Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "getting error: JasperReport" Watch "getting error: JasperReport" New topic
Author

getting error: JasperReport

Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Hi folks,

I am in a real trouble. I spent my whole day in this.

summary:
i am getting these runtime errors,



while doing this,



What I know, it is parsing the DataSourceReport.jrxml. But I dont know where the hell is E:\Tomcat50\DataSourceReport.java. I guess it is just on the fly, nothing is there on the hard disk.

brief introduction:
I am working on a web app and need to do reports. I have chosen JasperReport. Currently I am doing with Tomcat alone, haven't integrate it with Apache or something. I have added all the libraries in my ant script (build.xml). The compilation is successful and web app is running quite fine. Everything is fine JDBC, log4j, fileupload, etc.., , except report thing.

Do I need to do something more? please guide me towards light.
[ December 22, 2004: Message edited by: Adeel Ansari ]
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1075

Adeel,

I do not have much Idea about jasper report. but few things I want to share.

Around 6 month back I was evaluating all reporting tools available in market and end up with Formula one reporting engine, an actuate product. During same process , I worked little bit on jasper report as well.

That time i also faced the Datasource problem. and I found that whatever datasource you want to use in your application, same name should be there while devloping same.

1. while creating your jasper xml keep data source name same as on runtime.(There is a data source property in eclipse for jasper plug-in as I remember)

2. Place all the jars in the library of tomcat

thats what I can think as of now.

Hope this information add something to solve your problem.


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Thanks Shailesh,

I have all the jars inside my tomcat/common/lib, including jasperreport.jar, digester.jar, beanutil.jar, commoncollection.jar, etc. And i have given the path of all the jars in my ant script and all is compiling fine. Error occurs at runtime, on method call compileReportToFile().

Note: the jar names are not the actual names of files. I mentioned these just to give you an idea

The name inside file.jrxml is the same. As I mentioned it is DataSourceReport.jrxml, so the name attribute is the same DataSourceReport. I am expecting a file DataSourceReport.jasper. But it is stuck somewhere in between. The problem is why it is showing me the file DataSourceReport.java, the file on-the-fly, under my Tomcat home. It doesn't care where the actual file residing on my hard drive. It just says tomcat_home\DataSourceReport.java, and starts giving me errors. Now it really screwed me.

I have set all the environment variables too. But nothing works.

thanks.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
fixed it. thanks. now expecting some more new errors. will get you people for help.

thanks.
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1075

So what was the core reason for error

any way congrats
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Somewhere inside it was getting this,

System.getProperty("user.dir");

and this method was returning the string "E:\Tomcat50". So therefore the file on-the-file "DataSourceReport.java" was inside tomcat home. And from there when it was trying to compile that file using javac or jdk13 compiler. It was giving the error because no libraries found there. All of my jars are inside tomcat_home\common\lib.

Now its fine. Getting one more error after fixing that one. But dont worry i think i'll figure it out myself. But offcourse if not then I'll get back to ranch.

thanks.
 
IntelliJ Java IDE
 
subject: getting error: JasperReport
 
Threads others viewed
create report with java
Jasper Reports
jasper reports
Command line arguments
jasper in a WebApp
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com