• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Trying to call Jasper iReport through portlet & getting error

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have written the following code which is linked to a button in my portlet.



When I try to run this code I get the following error:


I have the following necessary files in my class path:


Please suggest me where I am going wrong.

Thanks & Regards
Saurabh.
[ November 27, 2007: Message edited by: Saurabh Joshi ]
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem looks to be ClassNotFound issue. How are referring those jar files. Did you try putting it in the war itself.
 
Saurabh Joshi
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just put those .jar files in my class path and nothing else.
Do I need to do something else also??
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
im trying to integrate JasperReport with portlet. when i try to execute my portlet on server (portal server 5.1) i get foolowing error:

org.apache.commons.logging.LogConfigurationException:
java.lang.ClassCastException: com.ibm.ws.commons.logging.TrLogFactory

Code ::
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, java.io.IOException {

String realPath = getPortletContext().getRealPath("/WEB-INF/report/HelloWorld.jrxml");
if (realPath == null)
throw new IOException("Cannot access war file content");

File file = new File(realPath);
if (!file.exists())
throw new IOException("File " + "/WEB-INF/report/HelloWorld.jrxml" + " does not exist");
else{
JasperDesign jasperDesign = null;
System.out.println("Try");
JasperReport jasperReport = null;;
try {
jasperDesign = JRXmlLoader.load(new FileInputStream(file));
jasperReport = jasperCompileManager.compileReport(jasperDesign);
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("error1 " + e);}

if ( jasperReport == null)
System.out.println("Not Complied");
else{HashMap parameterMap = new HashMap();
System.out.println("Poonam");
try {
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameterMap , new JREmptyDataSource());
JasperViewer.viewReport(jasperPrint,false);} catch (Exception e) {
System.out.println("error2 " + e);
}
}
//createReport(request,jasperPrint );

}
}
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic