• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to call Jasper iReport through portlet & getting error

 
Saurabh Joshi
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • 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 ]
 
Sanjay Kannan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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
  • 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??
 
Poonam Pose
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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 );

}
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic