This discussion is archived
6 Replies Latest reply: Nov 21, 2012 2:41 AM by fakhri.kharrat RSS

Integration of jasper with adf jdev

fakhri.kharrat Newbie
Currently Being Moderated
my jdev version is
and am using Integratedweblogic

I found this link

I try to integrate jasper IReport 3.0 with jdev, i add these jar files into my classpath:

5- jasper-compiler-jdt-5.5.15.jar

In web.xml add this
<res-type> javax.sql.DataSource </res-type>
<res-auth> Container </res-auth>

and in my backing bean i add these imports and methode


import java.sql.Connection;
import java.sql.SQLException;

import java.util.HashMap;
import java.util.Map;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import javax.sql.DataSource;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.view.JasperViewer;

public void printReport() throws FileNotFoundException, JRException, NamingException, SQLException, IOException {
InputStream input = new FileInputStream(new File("c:/yourJasperReport.xml"));
JasperDesign design = JRXmlLoader.load(input);
JasperReport report = JasperCompileManager.compileReport(design);
Map parameters = new HashMap();
// parameters.put("jasperParamenterName", "ParameterValue"); Used if you want to pass a parameter to a jasper report
InitialContext initialContext = new InitialContext();
DataSource ds = (DataSource)initialContext.lookup("java:comp/env/jdbc/gestDS"); // get from your application module configuration
Connection conn = ds.getConnection();
JasperPrint print = JasperFillManager.fillReport(report, parameters, conn);

JasperViewer.viewReport(print, true);

i add a method when clicking on the button but i did not make any reference to printReport()
public String do_print() {
// Add event code here...
return null;

i add also the jar file in my C:\Oracle\MiddleJdev11.1.2.3\jdeveloper\jdev\lib

when i run my app an error appear:

java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRException
     at java.lang.Class.getDeclaredMethods0(Native Method)
     at java.lang.Class.privateGetDeclaredMethods(
     at java.lang.Class.getDeclaredMethods(
     at oracle.adfinternal.controller.beans.AnnotationUtils.findAnnotatedMethods(

i found in many other forum using eclipse or netbeans that i have to add these files jar in WEB-INF/lib

Please can you help me because we plan to use jasper in our reporting


Edited by: fakhri_tn on Nov 21, 2012 1:09 AM


  • Correct Answers - 10 points
  • Helpful Answers - 5 points