This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Trying to call Jasper iReport through portlet & getting error

 
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 ]
 
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??
 
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 );

}
}
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!