Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

unable load jasperreports using java application

843841Jun 11 2005
I have created a report using jasperassistant.

But i could'nt run the report using my java
application.below given is the code sgment to call the
report.
_______________________________________________

try{
String rFile="/root/Production.jasper";
HashMap rptHash=null;
FileInputStream fs=new FileInputStream(rFile);
System.out.println("loading report file , read " +fs.available());
JasperReport template=(JasperReport)JRLoader.loadObject(fs);
System.out.println("Successfully created the report");
JasperPrint report=JasperFillManager.fillReport(template,rptHash,conn);
System.out.println("Report filled with data");
}catch(JRException jex)
{
System.out.println("Jasper Exception :"+jex.getMessage());
System.out.println("Jasper Exception :"+jex.fillnStackTrace());
System.out.println("Jasper Exception :"+jex.getStackTrace());
System.out.println("Jasper Exception :"+jex.getLocalizedMessage());
}


___________________________________________________


While running this application ,it throws into the
exception section.
Out put of the program is

Loading report file ,read 15275
Jasper Exception : Error loading object from InputStream
Jasper Exception :net.sf.jasperreports.engine.JRException :Error loading object from InputStream Jasper Exception :[Ljava.lang.StackTraceElement;@e7b241
Jasper Exception :Error loading object from InputStream

I request you to go through my code and give me some help to solve this asap.
thanking you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 9 2005
Added on Jun 11 2005
0 comments
560 views